Dmitry Timoshkov : gdi32: Search the child font list first.

Alexandre Julliard julliard at winehq.org
Mon Oct 27 08:03:03 CDT 2008


Module: wine
Branch: master
Commit: 2d15db61367e7c87c33b56f258c2a39f8ed1f568
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d15db61367e7c87c33b56f258c2a39f8ed1f568

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Oct 27 15:59:53 2008 +0800

gdi32: Search the child font list first.

---

 dlls/gdi32/freetype.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 9692450..313e625 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;




More information about the wine-cvs mailing list