Use hb_zip() moooore
This commit is contained in:
parent
0d1fdf939d
commit
af2067e87b
|
@ -100,11 +100,11 @@ struct SingleSubstFormat1
|
||||||
hb_sorted_vector_t<GlyphID> from;
|
hb_sorted_vector_t<GlyphID> from;
|
||||||
hb_vector_t<GlyphID> to;
|
hb_vector_t<GlyphID> to;
|
||||||
hb_codepoint_t delta = deltaGlyphID;
|
hb_codepoint_t delta = deltaGlyphID;
|
||||||
for (/*TODO(C++11)auto*/Coverage::iter_t iter = (this+coverage).iter (); iter; iter++)
|
for (auto it = (this+coverage).iter (); it; ++it)
|
||||||
|
if (glyphset.has (*it))
|
||||||
{
|
{
|
||||||
if (!glyphset.has (iter.get_glyph ())) continue;
|
from.push ()->set (glyph_map[*it]);
|
||||||
from.push ()->set (glyph_map[iter.get_glyph ()]);
|
to.push ()->set (glyph_map[(*it + delta) & 0xFFFF]);
|
||||||
to.push ()->set (glyph_map[(iter.get_glyph () + delta) & 0xFFFF]);
|
|
||||||
}
|
}
|
||||||
c->serializer->propagate_error (from, to);
|
c->serializer->propagate_error (from, to);
|
||||||
SingleSubst_serialize (c->serializer, from, to);
|
SingleSubst_serialize (c->serializer, from, to);
|
||||||
|
@ -186,11 +186,11 @@ struct SingleSubstFormat2
|
||||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||||
hb_sorted_vector_t<GlyphID> from;
|
hb_sorted_vector_t<GlyphID> from;
|
||||||
hb_vector_t<GlyphID> to;
|
hb_vector_t<GlyphID> to;
|
||||||
for (/*TODO(C++11)auto*/Coverage::iter_t iter = (this+coverage).iter (); iter; iter++)
|
for (auto it = hb_zip (this+coverage, substitute); it; ++it)
|
||||||
|
if (glyphset.has (it->first))
|
||||||
{
|
{
|
||||||
if (!glyphset.has (iter.get_glyph ())) continue;
|
from.push ()->set (glyph_map[it->first]);
|
||||||
from.push ()->set (glyph_map[iter.get_glyph ()]);
|
to.push ()->set (glyph_map[it->second]);
|
||||||
to.push ()->set (glyph_map[substitute[iter.get_coverage ()]]);
|
|
||||||
}
|
}
|
||||||
c->serializer->propagate_error (from, to);
|
c->serializer->propagate_error (from, to);
|
||||||
SingleSubst_serialize (c->serializer, from, to);
|
SingleSubst_serialize (c->serializer, from, to);
|
||||||
|
|
Loading…
Reference in New Issue