[PATCH 3/5] dwrite: Set font stretch from 'head' table as a fallback

Nikolay Sivov nsivov at codeweavers.com
Mon Aug 10 05:50:25 CDT 2015


---

-------------- next part --------------
>From aa0d7bd08fd9150f0b081fe64fdc4bf59a52bb8e Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri, 7 Aug 2015 15:37:57 +0300
Subject: [PATCH 3/5] dwrite: Set font stretch from 'head' table as a fallback

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

diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 852ad96..57660a3 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -133,8 +133,13 @@ typedef struct
 
 enum TT_HEAD_MACSTYLE
 {
-    TT_HEAD_MACSTYLE_BOLD   = 1 << 0,
-    TT_HEAD_MACSTYLE_ITALIC = 1 << 1,
+    TT_HEAD_MACSTYLE_BOLD      = 1 << 0,
+    TT_HEAD_MACSTYLE_ITALIC    = 1 << 1,
+    TT_HEAD_MACSTYLE_UNDERLINE = 1 << 2,
+    TT_HEAD_MACSTYLE_OUTLINE   = 1 << 3,
+    TT_HEAD_MACSTYLE_SHADOW    = 1 << 4,
+    TT_HEAD_MACSTYLE_CONDENSED = 1 << 5,
+    TT_HEAD_MACSTYLE_EXTENDED  = 1 << 6,
 };
 
 typedef struct
@@ -1051,6 +1056,11 @@ void opentype_get_font_properties(IDWriteFontFileStream *stream, DWRITE_FONT_FAC
         USHORT macStyle = GET_BE_WORD(tt_head->macStyle);
         if (macStyle & TT_HEAD_MACSTYLE_ITALIC)
             props->style = DWRITE_FONT_STYLE_ITALIC;
+
+        if (macStyle & TT_HEAD_MACSTYLE_CONDENSED)
+            props->stretch = DWRITE_FONT_STRETCH_CONDENSED;
+        else if (macStyle & TT_HEAD_MACSTYLE_EXTENDED)
+            props->stretch = DWRITE_FONT_STRETCH_EXPANDED;
     }
 
     TRACE("stretch=%d, weight=%d, style %d\n", props->stretch, props->weight, props->style);
-- 
2.1.4



More information about the wine-patches mailing list