gdi32: Fix ABC metrics for rotated font.

This commit is contained in:
Akihiro Sagawa 2014-01-10 20:29:58 +09:00 committed by Alexandre Julliard
parent b8f22f4755
commit f6bc356860
2 changed files with 16 additions and 4 deletions

View File

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

View File

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