From 52ebdff49d13f239efc886de935d47be9860f6e5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 27 Sep 2011 12:38:16 -0400 Subject: [PATCH] Fix GSUB lookuptype 1 subtype 1 delta wrapping --- src/hb-ot-layout-gsub-table.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 4f4c1719a..4c423cce1 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -47,7 +47,9 @@ struct SingleSubstFormat1 if (likely (index == NOT_COVERED)) return false; - glyph_id += deltaGlyphID; + /* According to the Adobe Annotated OpenType Suite, result is always + * limited to 16bit. */ + glyph_id = (glyph_id + deltaGlyphID) & 0xFFFF; c->replace_glyph (glyph_id); return true;