diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index f8b365bcccc..3cc8dd8b492 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6438,6 +6438,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, gm.gmCellIncY = 0; origin_x = left; origin_y = top; + abc->abcA = origin_x >> 6; + abc->abcB = metrics.width >> 6; } else { INT xc, yc; FT_Vector vec; @@ -6534,6 +6536,19 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, pFT_Vector_Transform(&vec, &transMatUnrotated); adv = pFT_MulFix(vec.x, em_scale) * 2; } + + vec.x = metrics.horiBearingX; + vec.y = 0; + pFT_Vector_Transform(&vec, &transMatUnrotated); + abc->abcA = vec.x >> 6; + + vec.x = metrics.width; + vec.y = 0; + pFT_Vector_Transform(&vec, &transMatUnrotated); + if (vec.x >= 0) + abc->abcB = vec.x >> 6; + else + abc->abcB = -vec.x >> 6; } width = (right - left) >> 6; @@ -6542,8 +6557,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, gm.gmBlackBoxY = height ? height : 1; gm.gmptGlyphOrigin.x = origin_x >> 6; gm.gmptGlyphOrigin.y = origin_y >> 6; - abc->abcA = left >> 6; - abc->abcB = gm.gmBlackBoxX; + if (!abc->abcB) abc->abcB = 1; abc->abcC = adv - abc->abcA - abc->abcB; TRACE("%u,%u,%s,%d,%d\n", gm.gmBlackBoxX, gm.gmBlackBoxY, diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 28bec523e8c..e05cfeaac8d 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1325,14 +1325,12 @@ static void test_GetCharABCWidths(void) ok(ret, "GetCharABCWidthsW should have succeeded\n"); /* 3) compare ABC results */ - todo_wine { ok(match_off_by_1(abcw[0].abcA, abc[0].abcA, FALSE), "got %d, expected %d (A)\n", abc[0].abcA, abcw[0].abcA); ok(match_off_by_1(abcw[0].abcB, abc[0].abcB, FALSE), "got %d, expected %d (B)\n", abc[0].abcB, abcw[0].abcB); ok(match_off_by_1(abcw[0].abcC, abc[0].abcC, FALSE), "got %d, expected %d (C)\n", abc[0].abcC, abcw[0].abcC); - } DeleteObject(SelectObject(hdc, hfont)); ReleaseDC(NULL, hdc);