dwrite/tests: Test for superscript/subscript font metrics.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-04-14 23:22:56 +03:00 committed by Alexandre Julliard
parent 7e1d1aa573
commit c7a174f76b
1 changed files with 26 additions and 0 deletions

View File

@ -1575,6 +1575,15 @@ static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_MET
metrics->strikethroughPosition = GET_BE_WORD(tt_os2->yStrikeoutPosition);
metrics->strikethroughThickness = GET_BE_WORD(tt_os2->yStrikeoutSize);
metrics->subscriptPositionX = GET_BE_WORD(tt_os2->ySubscriptXOffset);
metrics->subscriptPositionY = -GET_BE_WORD(tt_os2->ySubscriptYOffset);
metrics->subscriptSizeX = GET_BE_WORD(tt_os2->ySubscriptXSize);
metrics->subscriptSizeY = GET_BE_WORD(tt_os2->ySubscriptYSize);
metrics->superscriptPositionX = GET_BE_WORD(tt_os2->ySuperscriptXOffset);
metrics->superscriptPositionY = GET_BE_WORD(tt_os2->ySuperscriptYOffset);
metrics->superscriptSizeX = GET_BE_WORD(tt_os2->ySuperscriptXSize);
metrics->superscriptSizeY = GET_BE_WORD(tt_os2->ySuperscriptYSize);
}
if (tt_post) {
@ -1631,6 +1640,23 @@ static void check_font_metrics(const WCHAR *nameW, BOOL has_metrics1, const DWRI
m1->glyphBoxRight, expected->glyphBoxRight);
ok(m1->glyphBoxBottom == expected->glyphBoxBottom, "font %s: glyphBoxBottom %d, expected %d\n", wine_dbgstr_w(nameW),
m1->glyphBoxBottom, expected->glyphBoxBottom);
ok(m1->subscriptPositionX == expected->subscriptPositionX, "font %s: subscriptPositionX %d, expected %d\n",
wine_dbgstr_w(nameW), m1->subscriptPositionX, expected->subscriptPositionX);
ok(m1->subscriptPositionY == expected->subscriptPositionY, "font %s: subscriptPositionY %d, expected %d\n",
wine_dbgstr_w(nameW), m1->subscriptPositionY, expected->subscriptPositionY);
ok(m1->subscriptSizeX == expected->subscriptSizeX, "font %s: subscriptSizeX %d, expected %d\n",
wine_dbgstr_w(nameW), m1->subscriptSizeX, expected->subscriptSizeX);
ok(m1->subscriptSizeY == expected->subscriptSizeY, "font %s: subscriptSizeY %d, expected %d\n",
wine_dbgstr_w(nameW), m1->subscriptSizeY, expected->subscriptSizeY);
ok(m1->superscriptPositionX == expected->superscriptPositionX, "font %s: superscriptPositionX %d, expected %d\n",
wine_dbgstr_w(nameW), m1->superscriptPositionX, expected->superscriptPositionX);
ok(m1->superscriptPositionY == expected->superscriptPositionY, "font %s: superscriptPositionY %d, expected %d\n",
wine_dbgstr_w(nameW), m1->superscriptPositionY, expected->superscriptPositionY);
ok(m1->superscriptSizeX == expected->superscriptSizeX, "font %s: superscriptSizeX %d, expected %d\n",
wine_dbgstr_w(nameW), m1->superscriptSizeX, expected->superscriptSizeX);
ok(m1->superscriptSizeY == expected->superscriptSizeY, "font %s: superscriptSizeY %d, expected %d\n",
wine_dbgstr_w(nameW), m1->superscriptSizeY, expected->superscriptSizeY);
}
}