comparison src/w32uniscribe.c @ 96343:5c8f2b7d28ae

* w32font.h (FONT_HANDLE, FONT_TEXTMETRIC): New macros. * w32term.c (x_draw_glyph_string_foreground): (x_draw_composite_glyph_string_foreground): Sync with xterm.c. Use FONT_HANDLE macro. (x_draw_glyph_string): Use FONT_TEXTMETRIC macro. * w32uniscribe.c (uniscribe_otf_capability, uniscribe_shape): (uniscribe_encode_char): Use FONT_HANDLE macro. * w32font.c (Fx_select_font): Use FONT_HANDLE macro. (w32font_text_extents): Use precast w32_font. (w32font_close): Free cached metrics. (w32font_open_internal): Allocate space for name on stack.
author Jason Rumney <jasonr@gnu.org>
date Thu, 26 Jun 2008 22:11:25 +0000
parents 2fc5aff56d81
children 9ee160a11a03
comparison
equal deleted inserted replaced
96342:307d2d89ee24 96343:5c8f2b7d28ae
164 Lisp_Object capability = Fcons (Qnil, Qnil); 164 Lisp_Object capability = Fcons (Qnil, Qnil);
165 Lisp_Object features; 165 Lisp_Object features;
166 166
167 f = XFRAME (selected_frame); 167 f = XFRAME (selected_frame);
168 context = get_frame_dc (f); 168 context = get_frame_dc (f);
169 old_font = SelectObject (context, ((struct w32font_info *) font)->hfont); 169 old_font = SelectObject (context, FONT_HANDLE(font));
170 170
171 features = otf_features (context, "GSUB"); 171 features = otf_features (context, "GSUB");
172 XSETCAR (capability, features); 172 XSETCAR (capability, features);
173 features = otf_features (context, "GPOS"); 173 features = otf_features (context, "GPOS");
174 XSETCDR (capability, features); 174 XSETCDR (capability, features);
257 /* TODO: When we get BIDI support, we need to call ScriptLayout here. 257 /* TODO: When we get BIDI support, we need to call ScriptLayout here.
258 Requires that we know the surrounding context. */ 258 Requires that we know the surrounding context. */
259 259
260 f = XFRAME (selected_frame); 260 f = XFRAME (selected_frame);
261 context = get_frame_dc (f); 261 context = get_frame_dc (f);
262 old_font = SelectObject (context, uniscribe_font->w32_font.hfont); 262 old_font = SelectObject (context, FONT_HANDLE(font));
263 263
264 glyphs = alloca (max_glyphs * sizeof (WORD)); 264 glyphs = alloca (max_glyphs * sizeof (WORD));
265 clusters = alloca (nchars * sizeof (WORD)); 265 clusters = alloca (nchars * sizeof (WORD));
266 attributes = alloca (max_glyphs * sizeof (SCRIPT_VISATTR)); 266 attributes = alloca (max_glyphs * sizeof (SCRIPT_VISATTR));
267 advances = alloca (max_glyphs * sizeof (int)); 267 advances = alloca (max_glyphs * sizeof (int));
422 chars[0] = (wchar_t) c; 422 chars[0] = (wchar_t) c;
423 423
424 /* Use selected frame until API is updated to pass the frame. */ 424 /* Use selected frame until API is updated to pass the frame. */
425 f = XFRAME (selected_frame); 425 f = XFRAME (selected_frame);
426 context = get_frame_dc (f); 426 context = get_frame_dc (f);
427 old_font = SelectObject (context, ((struct w32font_info *) font)->hfont); 427 old_font = SelectObject (context, FONT_HANDLE(font));
428 428
429 retval = GetGlyphIndicesW (context, chars, 1, indices, 429 retval = GetGlyphIndicesW (context, chars, 1, indices,
430 GGI_MARK_NONEXISTING_GLYPHS); 430 GGI_MARK_NONEXISTING_GLYPHS);
431 431
432 SelectObject (context, old_font); 432 SelectObject (context, old_font);