diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index df3d2ddfbf4..8b57809a7d1 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -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; diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 49e7154b9b8..4af8338cbcd 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -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);