Nikolay Sivov : gdi32: Fix otmfsSelection to have bold style set in case of bold simulation.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Feb 10 11:11:08 CST 2016
Module: wine
Branch: master
Commit: c98f40e2272ca8aa20453ea307dca70124fccc8e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c98f40e2272ca8aa20453ea307dca70124fccc8e
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Feb 9 22:43:10 2016 +0300
gdi32: Fix otmfsSelection to have bold style set in case of bold simulation.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/freetype.c | 2 ++
dlls/gdi32/tests/font.c | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 1a488df..9fa520f 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -7850,6 +7850,8 @@ static BOOL get_outline_text_metrics(GdiFont *font)
font->potm->otmfsSelection = pOS2->fsSelection;
if (font->fake_italic)
font->potm->otmfsSelection |= 1;
+ if (font->fake_bold)
+ font->potm->otmfsSelection |= 1 << 5;
font->potm->otmfsType = pOS2->fsType;
font->potm->otmsCharSlopeRise = pHori->caret_Slope_Rise;
font->potm->otmsCharSlopeRun = pHori->caret_Slope_Run;
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index c56eb81..d1896a3 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2144,9 +2144,22 @@ static void test_GetOutlineTextMetrics(void)
LPSTR unset_ptr;
UINT fsSelection;
- /* check fsSelection field with oblique simulation */
+ /* check fsSelection field with bold simulation */
memset(&lf, 0, sizeof(lf));
+ strcpy(lf.lfFaceName, "Wingdings");
+ lf.lfCharSet = SYMBOL_CHARSET;
+
+ /* regular face */
+ fsSelection = get_font_fsselection(&lf);
+ ok((fsSelection & (1 << 5)) == 0, "got 0x%x\n", fsSelection);
+ /* face with bold simulation */
+ lf.lfWeight = FW_BOLD;
+ fsSelection = get_font_fsselection(&lf);
+ ok((fsSelection & (1 << 5)) != 0, "got 0x%x\n", fsSelection);
+
+ /* check fsSelection field with oblique simulation */
+ memset(&lf, 0, sizeof(lf));
strcpy(lf.lfFaceName, "Tahoma");
lf.lfHeight = -13;
lf.lfWeight = FW_NORMAL;
More information about the wine-cvs
mailing list