提交 925be292 编写于 作者: G Garret Rieger

Update hb-ot-vorg-table and hb-ot-layout-common to use the updated subset plan api.

上级 4af3be6e
......@@ -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))
{
if (plan->glyphs[glyph] > vertYOrigins[i].glyph)
i++;
else if (plan->glyphs[glyph] < vertYOrigins[i].glyph)
glyph++;
else
while (old_glyph > vertYOrigins[i].glyph)
{
VertOriginMetric *metrics = subset_metrics.push ();
metrics->glyph.set (glyph);
metrics->vertOriginY.set (vertYOrigins[i].vertOriginY);
glyph++;
i++;
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 (new_glyph);
metrics->vertOriginY.set (vertYOrigins[i].vertOriginY);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册