[PATCH] dwrite: Set lfItalic style to get more compatible results for gdiinterop

Nikolay Sivov <[email protected]>
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
Signed-off-by: Nikolay Sivov <[email protected]>
---

That fixes test failures on Marcus' machine. Relevant OpenSUSE font package is
google-roboto-fonts-20161103.2.135-1.3.noarch.rpm.

 dlls/dwrite/opentype.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 4f570f586c..18fb00be09 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -1375,6 +1375,7 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d
             props->style = DWRITE_FONT_STYLE_OBLIQUE;
         else if (fsSelection & OS2_FSSELECTION_ITALIC)
             props->style = DWRITE_FONT_STYLE_ITALIC;
+        props->lf.lfItalic = !!(fsSelection & OS2_FSSELECTION_ITALIC);
 
         memcpy(&props->panose, &tt_os2->panose, sizeof(props->panose));
 
@@ -1404,12 +1405,13 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d
         if (macStyle & TT_HEAD_MACSTYLE_BOLD)
             props->weight = DWRITE_FONT_WEIGHT_BOLD;
 
-        if (macStyle & TT_HEAD_MACSTYLE_ITALIC)
+        if (macStyle & TT_HEAD_MACSTYLE_ITALIC) {
             props->style = DWRITE_FONT_STYLE_ITALIC;
+            props->lf.lfItalic = 1;
+        }
     }
 
     props->lf.lfWeight = props->weight;
-    props->lf.lfItalic = props->style == DWRITE_FONT_STYLE_ITALIC;
 
     TRACE("stretch=%d, weight=%d, style %d\n", props->stretch, props->weight, props->style);
 
-- 
2.14.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.