Commit 13174a2f authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus/tests: Test GdipCreateFont character set initialization.

parent a240d380
......@@ -191,6 +191,78 @@ static void test_createfont(void)
GdipDeleteFontFamily(fontfamily);
}
static void test_createfont_charset(void)
{
GpFontFamily* fontfamily = NULL;
GpGraphics *graphics;
GpFont* font = NULL;
GpStatus stat;
LOGFONTW lf;
HDC hdc;
UINT i;
static const struct {
LPCWSTR family_name;
BYTE char_set;
BOOL todo;
} td[] =
{
{L"Tahoma", ANSI_CHARSET},
{L"Symbol", SYMBOL_CHARSET},
{L"Marlett", SYMBOL_CHARSET, TRUE},
{L"Wingdings", SYMBOL_CHARSET, TRUE},
};
hdc = CreateCompatibleDC(0);
stat = GdipCreateFromHDC(hdc, &graphics);
expect (Ok, stat);
for (i = 0; i < ARRAY_SIZE(td); i++)
{
winetest_push_context("%u", i);
stat = GdipCreateFontFamilyFromName(td[i].family_name, NULL, &fontfamily);
expect (Ok, stat);
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitPoint, &font);
expect (Ok, stat);
stat = GdipGetLogFontW(font, graphics, &lf);
expect(Ok, stat);
if (lstrcmpiW(lf.lfFaceName, td[i].family_name) != 0)
{
skip("%s not installed\n", wine_dbgstr_w(td[i].family_name));
}
else
{
ok(lf.lfHeight < 0, "Expected negative height, got %ld\n", lf.lfHeight);
expect(0, lf.lfWidth);
expect(0, lf.lfEscapement);
expect(0, lf.lfOrientation);
ok((lf.lfWeight >= 100) && (lf.lfWeight <= 900), "Expected weight to be set\n");
expect(0, lf.lfItalic);
expect(0, lf.lfUnderline);
expect(0, lf.lfStrikeOut);
todo_wine_if(td[i].todo)
ok(td[i].char_set == lf.lfCharSet ||
(td[i].char_set == ANSI_CHARSET && lf.lfCharSet == GetTextCharset(hdc)),
"got %#x\n", lf.lfCharSet);
expect(0, lf.lfOutPrecision);
expect(0, lf.lfClipPrecision);
expect(0, lf.lfQuality);
expect(0, lf.lfPitchAndFamily);
}
GdipDeleteFont(font);
GdipDeleteFontFamily(fontfamily);
winetest_pop_context();
}
GdipDeleteGraphics(graphics);
DeleteDC(hdc);
}
static void test_logfont(void)
{
LOGFONTA lfa, lfa2;
......@@ -1479,6 +1551,7 @@ START_TEST(font)
test_font_substitution();
test_font_metrics();
test_createfont();
test_createfont_charset();
test_logfont();
test_fontfamily();
test_fontfamily_properties();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment