summaryrefslogtreecommitdiff
path: root/src/w32font.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2009-02-12 15:00:26 +0000
committerJason Rumney <jasonr@gnu.org>2009-02-12 15:00:26 +0000
commit631ea4fbf83f461ed1cc0ec40a5b3ad41b2aa810 (patch)
treefcb7508250242458e787c781212ec9d5006f09f7 /src/w32font.c
parentcb4a3e4288f6f1e606fead5542f8be3973d5f0f9 (diff)
downloademacs-631ea4fbf83f461ed1cc0ec40a5b3ad41b2aa810.tar.gz
(check_face_name): Check for fake helv. (Bug#2275)
(add_font_entity_to_list): Call check_face_name even when family is unspecified.
Diffstat (limited to 'src/w32font.c')
-rw-r--r--src/w32font.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/w32font.c b/src/w32font.c
index d28483ada1e..848da7f464d 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -1374,6 +1374,14 @@ check_face_name (font, full_name)
_strlwr (full_iname);
return strstr ("helvetica", full_iname) != NULL;
}
+ /* Same for Helv. */
+ if (!xstrcasecmp (font->lfFaceName, "helv"))
+ {
+ strncpy (full_iname, full_name, LF_FULLFACESIZE);
+ full_iname[LF_FULLFACESIZE] = 0;
+ _strlwr (full_iname);
+ return strstr ("helv", full_iname) != NULL;
+ }
/* Since Times is mapped to Times New Roman, a substring
match is not sufficient to filter out the bogus match. */
@@ -1437,9 +1445,8 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
logical_font->elfLogFont.lfFaceName))
/* Check for well known substitutions that mess things up in the
presence of Type-1 fonts of the same name. */
- || (match_data->pattern.lfFaceName[0]
- && !check_face_name (&logical_font->elfLogFont,
- logical_font->elfFullName)))
+ || (!check_face_name (&logical_font->elfLogFont,
+ logical_font->elfFullName)))
return 1;
/* Make a font entity for the font. */