[subset] Fix ClassDefFormat1 subsetting
This commit is contained in:
parent
1b6d0c44b3
commit
7ee6128902
|
@ -1241,13 +1241,16 @@ struct ClassDefFormat1
|
||||||
inline bool subset (hb_subset_context_t *c) const
|
inline bool subset (hb_subset_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_SUBSET (this);
|
TRACE_SUBSET (this);
|
||||||
|
const hb_set_t &glyphset = *c->plan->glyphset;
|
||||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||||
hb_vector_t<GlyphID> glyphs;
|
hb_vector_t<GlyphID> glyphs;
|
||||||
hb_codepoint_t first_glyph = startGlyph;
|
hb_codepoint_t start = startGlyph;
|
||||||
unsigned int count = classValue.len;
|
hb_codepoint_t end = start + classValue.len;
|
||||||
glyphs.resize (count);
|
for (hb_codepoint_t g = start; g < end; g++)
|
||||||
for (unsigned i = 0; i < count; i++)
|
{
|
||||||
glyphs[i].set (glyph_map[first_glyph + i]);
|
if (!glyphset.has (g)) continue;
|
||||||
|
glyphs.push()->set (glyph_map[g]);
|
||||||
|
}
|
||||||
c->serializer->err (glyphs.in_error ());
|
c->serializer->err (glyphs.in_error ());
|
||||||
|
|
||||||
Supplier<GlyphID> glyphs_supplier (glyphs);
|
Supplier<GlyphID> glyphs_supplier (glyphs);
|
||||||
|
|
Loading…
Reference in New Issue