From 2d15db61367e7c87c33b56f258c2a39f8ed1f568 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 27 Oct 2008 15:59:53 +0800 Subject: [PATCH] gdi32: Search the child font list first. --- dlls/gdi32/freetype.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 96924506cf2..313e625362f 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3114,6 +3114,19 @@ static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pma fd.can_use_bitmap = can_use_bitmap; calc_hash(&fd); + /* try the child list */ + LIST_FOR_EACH(font_elem_ptr, &child_font_list) { + ret = LIST_ENTRY(font_elem_ptr, struct tagGdiFont, entry); + if(!fontcmp(ret, &fd)) { + if(!can_use_bitmap && !FT_IS_SCALABLE(ret->ft_face)) continue; + LIST_FOR_EACH(hfontlist_elem_ptr, &ret->hfontlist) { + hflist = LIST_ENTRY(hfontlist_elem_ptr, struct tagHFONTLIST, entry); + if(hflist->hfont == hfont) + return ret; + } + } + } + /* try the in-use list */ LIST_FOR_EACH(font_elem_ptr, &gdi_font_list) { ret = LIST_ENTRY(font_elem_ptr, struct tagGdiFont, entry); @@ -5340,6 +5353,7 @@ static BOOL load_child_font(GdiFont *font, CHILD_FONT *child) return FALSE; } + child->font->font_desc = font->font_desc; child->font->ntmFlags = child->face->ntmFlags; child->font->orientation = font->orientation; child->font->scale_y = font->scale_y; -- 2.11.4.GIT