|
|
|
@ -110,6 +110,7 @@ struct SingleSubstFormat1 |
|
|
|
|
inline bool subset (hb_subset_context_t *c) const |
|
|
|
|
{ |
|
|
|
|
TRACE_SUBSET (this); |
|
|
|
|
const hb_map_t &glyph_map = *c->plan->glyph_map; |
|
|
|
|
hb_vector_t<GlyphID> from; |
|
|
|
|
hb_vector_t<GlyphID> to; |
|
|
|
|
hb_codepoint_t delta = deltaGlyphID; |
|
|
|
@ -117,8 +118,8 @@ struct SingleSubstFormat1 |
|
|
|
|
{ |
|
|
|
|
if (!c->plan->glyphset->has (iter.get_glyph ())) |
|
|
|
|
continue; |
|
|
|
|
from.push ()->set (iter.get_glyph ()); |
|
|
|
|
to.push ()->set ((iter.get_glyph () + delta) & 0xFFFF); |
|
|
|
|
from.push ()->set (glyph_map[iter.get_glyph ()]); |
|
|
|
|
to.push ()->set (glyph_map[(iter.get_glyph () + delta) & 0xFFFF]); |
|
|
|
|
} |
|
|
|
|
c->serializer->err (from.in_error () || to.in_error ()); |
|
|
|
|
|
|
|
|
@ -216,14 +217,15 @@ struct SingleSubstFormat2 |
|
|
|
|
inline bool subset (hb_subset_context_t *c) const |
|
|
|
|
{ |
|
|
|
|
TRACE_SUBSET (this); |
|
|
|
|
const hb_map_t &glyph_map = *c->plan->glyph_map; |
|
|
|
|
hb_vector_t<GlyphID> from; |
|
|
|
|
hb_vector_t<GlyphID> to; |
|
|
|
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) |
|
|
|
|
{ |
|
|
|
|
if (!c->plan->glyphset->has (iter.get_glyph ())) |
|
|
|
|
continue; |
|
|
|
|
from.push ()->set (iter.get_glyph ()); |
|
|
|
|
to.push ()->set (substitute[iter.get_coverage ()]); |
|
|
|
|
from.push ()->set (glyph_map[iter.get_glyph ()]); |
|
|
|
|
to.push ()->set (glyph_map[substitute[iter.get_coverage ()]]); |
|
|
|
|
} |
|
|
|
|
c->serializer->err (from.in_error () || to.in_error ()); |
|
|
|
|
|
|
|
|
|