Akihiro Sagawa : gdi32: Fix synthetic bold outline text metrics.
Alexandre Julliard
julliard at winehq.org
Mon Feb 19 13:52:01 CST 2018
Module: wine
Branch: master
Commit: 68f9fb556d6ac51ed628d106a33737c13095fad4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=68f9fb556d6ac51ed628d106a33737c13095fad4
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Sun Feb 18 21:33:57 2018 +0900
gdi32: Fix synthetic bold outline text metrics.
Without this fix, synthetic tmAveCharWidth value unintentionally affects
SCALE_X calculation.
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/freetype.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 3833147..ba8855a 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -7554,6 +7554,11 @@ static void scale_font_metrics(const GdiFont *font, LPTEXTMETRICW ptm)
SCALE_Y(ptm->tmExternalLeading);
SCALE_Y(ptm->tmOverhang);
+ if(FT_IS_SCALABLE(font->ft_face) && font->fake_bold)
+ {
+ ptm->tmAveCharWidth++;
+ ptm->tmMaxCharWidth++;
+ }
SCALE_X(ptm->tmAveCharWidth);
SCALE_X(ptm->tmMaxCharWidth);
@@ -7778,11 +7783,8 @@ static BOOL get_outline_text_metrics(GdiFont *font)
}
TM.tmMaxCharWidth = SCALE_X(ft_face->bbox.xMax - ft_face->bbox.xMin);
TM.tmWeight = FW_REGULAR;
- if (font->fake_bold) {
- TM.tmAveCharWidth++;
- TM.tmMaxCharWidth++;
+ if (font->fake_bold)
TM.tmWeight = FW_BOLD;
- }
else
{
if (ft_face->style_flags & FT_STYLE_FLAG_BOLD)
More information about the wine-cvs
mailing list