Nikolay Sivov : dwrite: Fix character range to glyph range matching for user features.
Alexandre Julliard
julliard at winehq.org
Wed Feb 17 16:23:33 CST 2021
Module: wine
Branch: master
Commit: d4784a9211a18f247e1698f79d1dd02338df068a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d4784a9211a18f247e1698f79d1dd02338df068a
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Feb 17 13:33:23 2021 +0300
dwrite: Fix character range to glyph range matching for user features.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dwrite/opentype.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 125b7353031..39943c52c9a 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4733,7 +4733,7 @@ static void opentype_layout_get_glyph_range_for_text(struct scriptshaping_contex
if (end_char >= context->length - 1)
*end_glyph = context->glyph_count - 1;
else
- *end_glyph = context->u.buffer.clustermap[end_char + 1] - 1;
+ *end_glyph = context->u.buffer.clustermap[end_char] - 1;
}
static void opentype_layout_set_glyph_masks(struct scriptshaping_context *context, const struct shaping_features *features)
@@ -4754,6 +4754,9 @@ static void opentype_layout_set_glyph_masks(struct scriptshaping_context *contex
if (start_char >= context->length)
break;
+ if (!context->user_features.range_lengths[r])
+ continue;
+
opentype_layout_get_glyph_range_for_text(context, start_char, start_char + context->user_features.range_lengths[r],
&start_glyph, &end_glyph);
start_char += context->user_features.range_lengths[r];
More information about the wine-cvs
mailing list