Nikolay Sivov : dwrite/arabic: Use resolved codepoint for joining types.

Alexandre Julliard julliard at winehq.org
Thu Feb 11 15:37:14 CST 2021


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Feb 11 11:10:19 2021 +0300

dwrite/arabic: Use resolved codepoint for joining types.

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

---

 dlls/dwrite/dwrite_private.h | 1 +
 dlls/dwrite/opentype.c       | 1 +
 dlls/dwrite/shapers/arabic.c | 6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index fa36e92bde5..e03ad6c6c6d 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -521,6 +521,7 @@ struct shaping_glyph_info
     int attach_chain;
     /* Only relevant for isClusterStart glyphs. Indicates text position for this cluster. */
     unsigned int start_text_idx;
+    unsigned int codepoint;
 };
 
 struct shaping_glyph_properties
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 8885306a84d..515d2440fcf 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -5949,6 +5949,7 @@ static void opentype_get_nominal_glyphs(struct scriptshaping_context *context, c
         if (*context->u.subst.digits && codepoint >= '0' && codepoint <= '9')
             codepoint = context->u.subst.digits[codepoint - '0'];
 
+        context->glyph_infos[g].codepoint = codepoint;
         context->u.buffer.glyphs[g] = font->get_glyph(context->cache->context, codepoint);
         context->u.buffer.glyph_props[g].justification = SCRIPT_JUSTIFY_CHARACTER;
         opentype_set_subst_glyph_props(context, g);
diff --git a/dlls/dwrite/shapers/arabic.c b/dlls/dwrite/shapers/arabic.c
index cc701150a56..cc598f834e5 100644
--- a/dlls/dwrite/shapers/arabic.c
+++ b/dlls/dwrite/shapers/arabic.c
@@ -147,9 +147,9 @@ static void arabic_setup_masks(struct scriptshaping_context *context,
     unsigned int i, prev = ~0u, state = 0;
     unsigned int masks[NUM_FEATURES];
 
-    for (i = 0; i < context->length; ++i)
+    for (i = 0; i < context->glyph_count; ++i)
     {
-        unsigned short this_type = arabic_get_joining_type(context->text[i]);
+        unsigned short this_type = arabic_get_joining_type(context->glyph_infos[i].codepoint);
         const struct arabic_state_table_entry *entry;
 
         if (this_type == JOINING_TYPE_T)
@@ -173,7 +173,7 @@ static void arabic_setup_masks(struct scriptshaping_context *context,
         masks[i] = shape_get_feature_1_mask(features, arabic_features[i]);
 
     /* Unaffected glyphs get action NONE with zero mask. */
-    for (i = 0; i < context->length; ++i)
+    for (i = 0; i < context->glyph_count; ++i)
         context->glyph_infos[i].mask |= masks[arabic_get_shaping_action(context, i)];
 }
 




More information about the wine-cvs mailing list