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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 8 16:10:36 CST 2014


Module: wine
Branch: master
Commit: 517185fcf39356faecfc1e544ed7581b5713b708
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=517185fcf39356faecfc1e544ed7581b5713b708

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Dec  8 13:22:01 2014 +0300

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

---

 dlls/dwrite/font.c       | 8 +++++++-
 dlls/dwrite/tests/font.c | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index df3d2dd..8b57809 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 49e7154..4af8338 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);
 




More information about the wine-cvs mailing list