gdi32: Fix otmfsSelection to have bold style set in case of bold simulation.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-02-09 22:43:10 +03:00 committed by Alexandre Julliard
parent 90eb26015e
commit c98f40e227
2 changed files with 16 additions and 1 deletions

View File

@ -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;

View File

@ -2144,9 +2144,22 @@ static void test_GetOutlineTextMetrics(void)
LPSTR unset_ptr;
UINT fsSelection;
/* 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;