Nikolay Sivov : dwrite: Normalize glyph data before passing it to matching function.

Alexandre Julliard julliard at winehq.org
Thu Jun 11 15:26:46 CDT 2020


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jun 11 15:08:58 2020 +0300

dwrite: Normalize glyph data before passing it to matching function.

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

---

 dlls/dwrite/opentype.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 5def6042be..63b35155b3 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -3746,7 +3746,7 @@ static BOOL opentype_match_class_func(UINT16 glyph, UINT16 glyph_data, const str
 static BOOL opentype_match_coverage_func(UINT16 glyph, UINT16 glyph_data, const struct match_data *data)
 {
     const struct match_context *mc = data->mc;
-    return opentype_layout_is_glyph_covered(&mc->context->table->table, data->subtable_offset + GET_BE_WORD(glyph_data), glyph)
+    return opentype_layout_is_glyph_covered(&mc->context->table->table, data->subtable_offset + glyph_data, glyph)
             != GLYPH_NOT_COVERED;
 }
 
@@ -3808,8 +3808,10 @@ static enum iterator_match glyph_iterator_may_match(const struct glyph_iterator
     if (!(iter->mask & iter->context->glyph_infos[iter->pos].mask))
         return ITER_NO;
 
+    /* Glyph data is used for input, backtrack, and lookahead arrays, swap it here instead of doing that
+       in all matching functions. */
     if (iter->match_func)
-        return !!iter->match_func(iter->context->u.buffer.glyphs[iter->pos], *iter->glyph_data, iter->match_data);
+        return !!iter->match_func(iter->context->u.buffer.glyphs[iter->pos], GET_BE_WORD(*iter->glyph_data), iter->match_data);
 
     return ITER_MAYBE;
 }




More information about the wine-cvs mailing list