Also fix the reported width on existing tests
From: Brendan McGrath bmcgrath@codeweavers.com
Also fix the reported width on existing tests --- dlls/gdi32/tests/font.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 76ea0ac7de7..f8c7833fef0 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1313,24 +1313,30 @@ static void test_GetCharABCWidths(void) } for (j = 1; j <= 80; j++) { - GLYPHMETRICS gm; + GLYPHMETRICS gm, gm_bitmap;
lf.lfWidth = j; hfont = CreateFontIndirectA(&lf); hfont = SelectObject(hdc, hfont);
nb = GetGlyphOutlineA(hdc, code, GGO_METRICS, &gm, 0, NULL, &mat); - ok(nb, "GetGlyphOutlineA should have succeeded at width %d\n", i); + ok(nb, "GetGlyphOutlineA should have succeeded at width %d\n", j); + + nb = GetGlyphOutlineA(hdc, code, GGO_BITMAP, &gm_bitmap, 0, NULL, &mat); + ok(nb, "GetGlyphOutlineA should have succeeded with bitmap at width %d\n", j);
ret = GetCharABCWidthsA(hdc, code, code, abc); - ok(ret, "GetCharABCWidthsA should have succeeded at width %d\n", i); + ok(ret, "GetCharABCWidthsA should have succeeded at width %d\n", j);
ok(abc[0].abcA == gm.gmptGlyphOrigin.x, "abcA(%d) and gmptGlyphOrigin.x(%ld) values are different at width %d\n", - abc[0].abcA, gm.gmptGlyphOrigin.x, i); + abc[0].abcA, gm.gmptGlyphOrigin.x, j); ok(abc[0].abcB == gm.gmBlackBoxX, "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n", - abc[0].abcB, gm.gmBlackBoxX, i); + abc[0].abcB, gm.gmBlackBoxX, j); + todo_wine_if(i == 1 && j == 7) ok(abc[0].abcA + abc[0].abcB + abc[0].abcC == gm_bitmap.gmCellIncX, + "sum of abc value (%d, %d, %d) is different to gmCellIncX of bitmap (%d) at width %d\n", + abc[0].abcA, abc[0].abcB, abc[0].abcC, gm_bitmap.gmCellIncX, j); DeleteObject(SelectObject(hdc, hfont)); } }
From: Brendan McGrath bmcgrath@codeweavers.com
When rendering the bitmap, bitmap strikes are used, but they were not being used when reporting metrics. This resulted in discrepancies between some characters in some font sizes.
This fixes words from being truncated unnecessarily from a static control. --- dlls/gdi32/tests/font.c | 2 +- dlls/win32u/freetype.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index f8c7833fef0..0c472cbf75e 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1334,7 +1334,7 @@ static void test_GetCharABCWidths(void) ok(abc[0].abcB == gm.gmBlackBoxX, "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n", abc[0].abcB, gm.gmBlackBoxX, j); - todo_wine_if(i == 1 && j == 7) ok(abc[0].abcA + abc[0].abcB + abc[0].abcC == gm_bitmap.gmCellIncX, + ok(abc[0].abcA + abc[0].abcB + abc[0].abcC == gm_bitmap.gmCellIncX, "sum of abc value (%d, %d, %d) is different to gmCellIncX of bitmap (%d) at width %d\n", abc[0].abcA, abc[0].abcB, abc[0].abcC, gm_bitmap.gmCellIncX, j); DeleteObject(SelectObject(hdc, hfont)); diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 6043c66bc53..897e8ab78f4 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -3464,7 +3464,7 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT if (vertical_metrics && FT_SimpleVersion < FT_VERSION_VALUE(2, 4, 0)) vertical_metrics = FALSE;
- if (matrices || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; + if (matrices || format & GGO_NATIVE) load_flags |= FT_LOAD_NO_BITMAP; if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT;
err = pFT_Load_Glyph(ft_face, glyph, load_flags);