dwrite: Set font style to oblique when oblique simulation, was requested.

This commit is contained in:
Nikolay Sivov 2014-12-08 13:22:01 +03:00 committed by Alexandre Julliard
parent 19c860499a
commit 517185fcf3
2 changed files with 9 additions and 3 deletions

View File

@ -87,6 +87,7 @@ struct dwrite_font {
IDWriteFontFamily *family;
USHORT simulations;
DWRITE_FONT_STYLE style;
struct dwrite_font_data *data;
};
@ -738,7 +739,7 @@ static DWRITE_FONT_STYLE WINAPI dwritefont_GetStyle(IDWriteFont2 *iface)
{
struct dwrite_font *This = impl_from_IDWriteFont2(iface);
TRACE("(%p)\n", This);
return This->data->style;
return This->style;
}
static BOOL WINAPI dwritefont_IsSymbolFont(IDWriteFont2 *iface)
@ -1001,9 +1002,14 @@ static HRESULT create_font(struct dwrite_font_data *data, IDWriteFontFamily *fam
This->family = family;
IDWriteFontFamily_AddRef(family);
This->simulations = simulations;
This->style = data->style;
This->data = data;
InterlockedIncrement(&This->data->ref);
/* set oblique style from requested simulation */
if ((simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE) && data->style == DWRITE_FONT_STYLE_NORMAL)
This->style = DWRITE_FONT_STYLE_OBLIQUE;
*font = (IDWriteFont*)&This->IDWriteFont2_iface;
return S_OK;

View File

@ -441,10 +441,10 @@ if (0)
ok(weight == DWRITE_FONT_WEIGHT_NORMAL, "got %d\n", weight);
style = IDWriteFont_GetStyle(font);
todo_wine {
ok(style == DWRITE_FONT_STYLE_OBLIQUE, "got %d\n", style);
todo_wine
ok(otm.otmfsSelection == 1, "got 0x%08x\n", otm.otmfsSelection);
}
ret = IDWriteFont_IsSymbolFont(font);
ok(!ret, "got %d\n", ret);