comparison src/w32font.c @ 91182:bbdb7226d848

(add_font_entity_to_list): Compare only the beginning of full name.
author Jason Rumney <jasonr@gnu.org>
date Tue, 04 Dec 2007 19:45:31 +0000
parents 5e7347695108
children 98329725c530
comparison
equal deleted inserted replaced
91181:392369adecec 91182:bbdb7226d848
115 Lisp_Object list; 115 Lisp_Object list;
116 }; 116 };
117 117
118 /* Handles the problem that EnumFontFamiliesEx will not return all 118 /* Handles the problem that EnumFontFamiliesEx will not return all
119 style variations if the font name is not specified. */ 119 style variations if the font name is not specified. */
120 static void list_all_matching_fonts P_ ((struct font_callback_data *match_data)); 120 static void list_all_matching_fonts P_ ((struct font_callback_data *match));
121 121
122 122
123 /* MingW headers only define this when _WIN32_WINNT >= 0x0500, but we 123 /* MingW headers only define this when _WIN32_WINNT >= 0x0500, but we
124 target older versions. */ 124 target older versions. */
125 #ifndef GGI_MARK_NONEXISTING_GLYPHS
125 #define GGI_MARK_NONEXISTING_GLYPHS 1 126 #define GGI_MARK_NONEXISTING_GLYPHS 1
127 #endif
126 128
127 static int 129 static int
128 memq_no_quit (elt, list) 130 memq_no_quit (elt, list)
129 Lisp_Object elt, list; 131 Lisp_Object elt, list;
130 { 132 {
501 /* w32 implementation of draw for font backend. 503 /* w32 implementation of draw for font backend.
502 Optional. 504 Optional.
503 Draw glyphs between FROM and TO of S->char2b at (X Y) pixel 505 Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
504 position of frame F with S->FACE and S->GC. If WITH_BACKGROUND 506 position of frame F with S->FACE and S->GC. If WITH_BACKGROUND
505 is nonzero, fill the background in advance. It is assured that 507 is nonzero, fill the background in advance. It is assured that
506 WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */ 508 WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars).
509
510 TODO: Currently this assumes that the colors and fonts are already
511 set in the DC. This seems to be true now, but maybe only due to
512 the old font code setting it up. It may be safer to resolve faces
513 and fonts in here and set them explicitly
514 */
515
507 static int 516 static int
508 w32font_draw (s, from, to, x, y, with_background) 517 w32font_draw (s, from, to, x, y, with_background)
509 struct glyph_string *s; 518 struct glyph_string *s;
510 int from, to, x, y, with_background; 519 int from, to, x, y, with_background;
511 { 520 {
970 979
971 if (logfonts_match (&logical_font->elfLogFont, &match_data->pattern) 980 if (logfonts_match (&logical_font->elfLogFont, &match_data->pattern)
972 && font_matches_spec (font_type, physical_font, 981 && font_matches_spec (font_type, physical_font,
973 match_data->orig_font_spec) 982 match_data->orig_font_spec)
974 /* Avoid Windows substitution so we can control substitution with 983 /* Avoid Windows substitution so we can control substitution with
975 alternate-fontname-alist. */ 984 alternate-fontname-alist. Full name may have Bold and/or Italic
976 && !strnicmp (&logical_font->elfFullName, 985 appended, so only compare the beginning of the name. */
977 &match_data->pattern.lfFaceName, LF_FACESIZE)) 986 && !strnicmp ((char *)&logical_font->elfFullName,
987 (char *)&match_data->pattern.lfFaceName,
988 min (strlen(&match_data->pattern.lfFaceName), LF_FACESIZE)))
978 { 989 {
979 Lisp_Object entity 990 Lisp_Object entity
980 = w32_enumfont_pattern_entity (match_data->frame, logical_font, 991 = w32_enumfont_pattern_entity (match_data->frame, logical_font,
981 physical_font, font_type, 992 physical_font, font_type,
982 &match_data->pattern); 993 &match_data->pattern);