[1/2] gdi32: Fix lfWidth before caching the font to avoid duplicate entries in the cache.

Dmitry Timoshkov dmitry at codeweavers.com
Mon Apr 7 07:23:55 CDT 2008


Hello,

Changelog:
    gdi32: Fix lfWidth before caching the font to avoid duplicate entries
    in the cache.
---
 dlls/gdi32/freetype.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 0284a00..200a2c6 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -3120,6 +3120,8 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
         LeaveCriticalSection( &freetype_cs );
         return NULL;
     }
+    lf.lfWidth = abs(lf.lfWidth);
+
     can_use_bitmap = GetDeviceCaps(dc->hSelf, TEXTCAPS) & TC_RA_ABLE;
 
     TRACE("%s, h=%d, it=%d, weight=%d, PandF=%02x, charset=%d orient %d escapement %d\n",
@@ -3378,7 +3380,7 @@ found:
     TRACE("Chosen: %s %s (%s/%p:%ld)\n", debugstr_w(family->FamilyName),
 	  debugstr_w(face->StyleName), face->file, face->font_data_ptr, face->face_index);
 
-    ret->aveWidth = height ? abs(lf.lfWidth) : 0;
+    ret->aveWidth = height ? lf.lfWidth : 0;
 
     if(!face->scalable) {
         /* Windows uses integer scaling factors for bitmap fonts */
-- 
1.5.4.5






More information about the wine-patches mailing list