From: Kusanagi Kouichi Subject: gdi32: find_face_from_filename() needs to take font replacements into account. Message-Id: <20120314120150.1C7426FC039@msa105.auone-net.jp> Date: Wed, 14 Mar 2012 21:01:49 +0900 Fix bug 30159. Signed-off-by: Kusanagi Kouichi --- dlls/gdi32/freetype.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 4d4a37d..ec39814 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -890,6 +890,14 @@ static inline FT_Fixed FT_FixedFromFIXED(FIXED f) } +static const struct list *get_face_list_from_family(const Family *family) +{ + if (!list_empty(&family->faces)) + return &family->faces; + else + return family->replacement; +} + static Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_name) { Family *family; @@ -903,9 +911,11 @@ static Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_n LIST_FOR_EACH_ENTRY(family, &font_list, Family, entry) { + const struct list *face_list; if(face_name && strcmpiW(face_name, family->FamilyName)) continue; - LIST_FOR_EACH_ENTRY(face, &family->faces, Face, entry) + face_list = get_face_list_from_family(family); + LIST_FOR_EACH_ENTRY(face, face_list, Face, entry) { if (!face->file) continue; @@ -1957,14 +1967,6 @@ static SYSTEM_LINKS *find_font_link(const WCHAR *name) return NULL; } -static const struct list *get_face_list_from_family(const Family *family) -{ - if (!list_empty(&family->faces)) - return &family->faces; - else - return family->replacement; -} - static void populate_system_links(const WCHAR *name, const WCHAR *const *values) { const WCHAR *value; -- 1.7.9.1