[PATCH] gdi32: Fix otmfsSelection to have bold style set in case of bold simulation

Nikolay Sivov nsivov at codeweavers.com
Tue Feb 9 13:43:10 CST 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 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;
-- 
2.7.0




More information about the wine-patches mailing list