gdi32: Don't use pOS2->usWeightClass, some fonts don't set it correctly.

Dmitry Timoshkov dmitry at codeweavers.com
Wed Sep 10 06:58:13 CDT 2008


This patch fixes the problem reported in the bug #15197. The fonts pack
attached there has pOS2->usWeightClass set to 7 for Bold, which is wrong.
---
 dlls/gdi32/freetype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 74e70ea..dcd60e3 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -5165,7 +5165,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
         TM.tmAveCharWidth = 1; 
     }
     TM.tmMaxCharWidth = (pFT_MulFix(ft_face->bbox.xMax - ft_face->bbox.xMin, x_scale) + 32) >> 6;
-    TM.tmWeight = font->fake_bold ? FW_BOLD : pOS2->usWeightClass;
+    TM.tmWeight = (font->fake_bold || (ft_face->style_flags & FT_STYLE_FLAG_BOLD)) ? FW_BOLD : FW_REGULAR;
     TM.tmOverhang = 0;
     TM.tmDigitizedAspectX = 300;
     TM.tmDigitizedAspectY = 300;
-- 
1.6.0.1






More information about the wine-patches mailing list