diff options
| author | Jason Rumney | 2007-12-04 19:45:31 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-12-04 19:45:31 +0000 |
| commit | a74ddbdaeefea946135708f69168b7be07a2fa0b (patch) | |
| tree | 5dd6a50b370b75f15f66553d0511f35fb52339b5 | |
| parent | 3240618b729d06247e937f750aab2eadaac99d15 (diff) | |
| download | emacs-a74ddbdaeefea946135708f69168b7be07a2fa0b.tar.gz emacs-a74ddbdaeefea946135708f69168b7be07a2fa0b.zip | |
(add_font_entity_to_list): Compare only the beginning of full name.
| -rw-r--r-- | src/w32font.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/w32font.c b/src/w32font.c index 54181713158..adfdc34b21a 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -117,12 +117,14 @@ struct font_callback_data | |||
| 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) |
| @@ -503,7 +505,14 @@ w32font_text_extents (font, code, nglyphs, metrics) | |||
| 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; |
| @@ -972,9 +981,11 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam) | |||
| 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, |