gdi32: Fix lfWidth before caching the font to avoid duplicate entries in the cache.
authorDmitry Timoshkov <dmitry@codeweavers.com>
Mon, 7 Apr 2008 12:23:55 +0000 (21:23 +0900)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 7 Apr 2008 18:34:37 +0000 (20:34 +0200)
dlls/gdi32/freetype.c

index be8688a1d914cbf2366df9cab7bab4b538da622d..b00bc71a4492cb96a3c655b12557041ecbc013fe 100644 (file)
@@ -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",
@@ -3382,7 +3384,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 */