[PATCH 4/5] dwrite: Update glyph component count on multiple substitution.

Nikolay Sivov nsivov at codeweavers.com
Thu May 28 06:54:28 CDT 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/dwrite_private.h | 13 ++++++++++++-
 dlls/dwrite/opentype.c       | 10 +++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index 2ed53658cd2..94705b0d636 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -468,6 +468,17 @@ struct shaping_glyph_info
     unsigned int props;
 };
 
+struct shaping_glyph_properties
+{
+    UINT16 justification : 4;
+    UINT16 isClusterStart : 1;
+    UINT16 isDiacritic : 1;
+    UINT16 isZeroWidthSpace : 1;
+    UINT16 reserved : 1;
+    UINT16 components : 4;
+    UINT16 reserved2 : 4;
+};
+
 struct scriptshaping_context
 {
     struct scriptshaping_cache *cache;
@@ -498,7 +509,7 @@ struct scriptshaping_context
         struct
         {
             UINT16 *glyphs;
-            DWRITE_SHAPING_GLYPH_PROPERTIES *glyph_props;
+            struct shaping_glyph_properties *glyph_props;
             UINT16 *clustermap;
         } buffer;
     } u;
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index e31057710b4..92061cbf5ca 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4648,7 +4648,10 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
                 glyph = GET_BE_WORD(glyphs[i]);
                 context->u.subst.glyphs[idx + i] = glyph;
                 if (i)
+                {
                     context->u.subst.glyph_props[idx + i].isClusterStart = 0;
+                    context->u.buffer.glyph_props[idx + i].components = 0;
+                }
                 opentype_set_subst_glyph_props(context, idx + i, glyph);
                 /* Inherit feature mask from original matched glyph. */
                 context->glyph_infos[idx + i].mask = mask;
@@ -5081,11 +5084,12 @@ static void opentype_get_nominal_glyphs(struct scriptshaping_context *context, c
             codepoint = context->u.subst.digits[codepoint - '0'];
 
         context->u.subst.glyphs[g] = font->get_glyph(context->cache->context, codepoint);
-        context->u.subst.glyph_props[g].justification = SCRIPT_JUSTIFY_CHARACTER;
-        context->u.subst.glyph_props[g].isClusterStart = 1;
+        context->u.buffer.glyph_props[g].justification = SCRIPT_JUSTIFY_CHARACTER;
+        context->u.buffer.glyph_props[g].isClusterStart = 1;
         opentype_set_subst_glyph_props(context, g, context->u.subst.glyphs[g]);
         if (opentype_is_default_ignorable(codepoint))
-            context->u.subst.glyph_props[g].isZeroWidthSpace = 1;
+            context->u.buffer.glyph_props[g].isZeroWidthSpace = 1;
+        context->u.buffer.glyph_props[g].components = 1;
         context->glyph_count++;
 
         clustermap[i] = i;
-- 
2.26.2




More information about the wine-devel mailing list