[PATCH 2/5] dwrite: Only enable single substitution lookups for chained substitution.

Nikolay Sivov nsivov at codeweavers.com
Tue May 26 03:16:09 CDT 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/opentype.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 5d90bad79c7..54d066e0173 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4550,7 +4550,7 @@ static BOOL opentype_layout_context_match_lookahead(struct glyph_iterator *iter,
 }
 
 static void opentype_layout_apply_gsub_lookup(struct scriptshaping_context *context, unsigned int first_glyph,
-        unsigned int glyph_count, int lookup_index);
+        unsigned int glyph_count, int lookup_index, BOOL only_single);
 
 static BOOL opentype_layout_context_gsub_apply_lookup(struct glyph_iterator *iter, unsigned int count,
         unsigned int lookup_count, const UINT16 *lookup_records)
@@ -4559,7 +4559,7 @@ static BOOL opentype_layout_context_gsub_apply_lookup(struct glyph_iterator *ite
         FIXME("Only first lookup used.\n");
 
     opentype_layout_apply_gsub_lookup(iter->context, iter->pos + GET_BE_WORD(lookup_records[0]), count,
-            GET_BE_WORD(lookup_records[1]));
+            GET_BE_WORD(lookup_records[1]), TRUE);
 
     return TRUE;
 }
@@ -4661,7 +4661,7 @@ static BOOL opentype_layout_apply_gsub_chain_context_substitution(struct glyph_i
 }
 
 static void opentype_layout_apply_gsub_lookup(struct scriptshaping_context *context, unsigned int first_glyph,
-        unsigned int glyph_count, int lookup_index)
+        unsigned int glyph_count, int lookup_index, BOOL only_single)
 {
     struct ot_gsubgpos_table *table = &context->cache->gsub;
     const struct ot_lookup_table *lookup_table;
@@ -4685,6 +4685,9 @@ static void opentype_layout_apply_gsub_lookup(struct scriptshaping_context *cont
     lookup_type = GET_BE_WORD(lookup_table->lookup_type);
     lookup.flags = GET_BE_WORD(lookup_table->flags);
 
+    if (lookup_type != GSUB_LOOKUP_SINGLE_SUBST && only_single)
+        return;
+
     glyph_iterator_init(context, lookup.flags, first_glyph, glyph_count, &iter);
 
     while (iter.pos < first_glyph + iter.len)
@@ -4798,7 +4801,7 @@ HRESULT opentype_layout_apply_gsub_features(struct scriptshaping_context *contex
     opentype_layout_set_glyph_masks(context, features);
 
     for (i = 0; i < lookups.count; ++i)
-        opentype_layout_apply_gsub_lookup(context, 0, context->glyph_count, lookups.lookups[i].index);
+        opentype_layout_apply_gsub_lookup(context, 0, context->glyph_count, lookups.lookups[i].index, FALSE);
 
     heap_free(lookups.lookups);
 
-- 
2.26.2




More information about the wine-devel mailing list