diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index ddda62a0a..3d658ac62 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -330,7 +330,7 @@ struct Charset0 { mapping->resize (num_glyphs, false); for (hb_codepoint_t gid = 1; gid < num_glyphs; gid++) - mapping->arrayZ[gid] = {sids[gid - 1], gid + 1}; + mapping->arrayZ[gid] = {sids[gid - 1], gid}; } hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const @@ -438,7 +438,7 @@ struct Charset1_2 { unsigned count = ranges[i].nLeft + 1; unsigned last = gid + count; for (unsigned j = 0; j < count; j++) - mapping->arrayZ[gid++] = {sid++, last}; + mapping->arrayZ[gid++] = {sid++, last - 1}; if (gid >= num_glyphs) break; diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 8b5e099f5..835200508 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -557,7 +557,7 @@ struct cff1_subset_plan if (glyph == old_glyph && skip) { - glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph - 1); + glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph); sid += glyph - old_glyph; } }