Nikolay Sivov : dwrite: Only enable single substitution lookups for chained substitution.

Alexandre Julliard julliard at winehq.org
Tue May 26 17:17:06 CDT 2020


Module: wine
Branch: master
Commit: 5625a8e52deb7a6a43586a2c4ca6d1ad2ba7401a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5625a8e52deb7a6a43586a2c4ca6d1ad2ba7401a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue May 26 11:16:09 2020 +0300

dwrite: Only enable single substitution lookups for chained substitution.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 5d90bad79c..54d066e017 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);
 




More information about the wine-cvs mailing list