Update hb-ot-vorg-table and hb-ot-layout-common to use the updated subset plan api.
This commit is contained in:
parent
4af3be6ef8
commit
925be29223
|
@ -1222,7 +1222,7 @@ struct ClassDefFormat1
|
|||
bool subset (hb_subset_context_t *c) const
|
||||
{
|
||||
TRACE_SUBSET (this);
|
||||
const hb_set_t &glyphset = *c->plan->glyphset;
|
||||
const hb_set_t &glyphset = *c->plan->glyphset ();
|
||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||
hb_vector_t<GlyphID> glyphs;
|
||||
hb_vector_t<HBUINT16> klasses;
|
||||
|
@ -1369,7 +1369,7 @@ struct ClassDefFormat2
|
|||
bool subset (hb_subset_context_t *c) const
|
||||
{
|
||||
TRACE_SUBSET (this);
|
||||
const hb_set_t &glyphset = *c->plan->glyphset;
|
||||
const hb_set_t &glyphset = *c->plan->glyphset ();
|
||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||
hb_vector_t<GlyphID> glyphs;
|
||||
hb_vector_t<HBUINT16> klasses;
|
||||
|
|
|
@ -110,21 +110,29 @@ struct VORG
|
|||
/* count the number of glyphs to be included in the subset table */
|
||||
hb_vector_t<VertOriginMetric> subset_metrics;
|
||||
subset_metrics.init ();
|
||||
unsigned int glyph = 0;
|
||||
|
||||
|
||||
hb_codepoint_t old_glyph = HB_SET_VALUE_INVALID;
|
||||
unsigned int i = 0;
|
||||
while ((glyph < plan->glyphs.length) && (i < vertYOrigins.len))
|
||||
while (i < vertYOrigins.len
|
||||
&& plan->glyphset ()->next (&old_glyph))
|
||||
{
|
||||
while (old_glyph > vertYOrigins[i].glyph)
|
||||
{
|
||||
if (plan->glyphs[glyph] > vertYOrigins[i].glyph)
|
||||
i++;
|
||||
else if (plan->glyphs[glyph] < vertYOrigins[i].glyph)
|
||||
glyph++;
|
||||
else
|
||||
if (i >= vertYOrigins.len)
|
||||
break;
|
||||
}
|
||||
|
||||
if (old_glyph == vertYOrigins[i].glyph)
|
||||
{
|
||||
hb_codepoint_t new_glyph;
|
||||
if (plan->new_gid_for_old_gid (old_glyph, &new_glyph))
|
||||
{
|
||||
VertOriginMetric *metrics = subset_metrics.push ();
|
||||
metrics->glyph.set (glyph);
|
||||
metrics->glyph.set (new_glyph);
|
||||
metrics->vertOriginY.set (vertYOrigins[i].vertOriginY);
|
||||
glyph++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue