[hmtx] Remove one subset-specific method from hmtx accelerator
Looks ugly but is the right thing to do.
This commit is contained in:
parent
af407dd24d
commit
9ba520b5d1
|
@ -262,11 +262,10 @@ struct hmtxvmtx
|
||||||
unsigned int num_advances_for_subset (const hb_subset_plan_t *plan) const
|
unsigned int num_advances_for_subset (const hb_subset_plan_t *plan) const
|
||||||
{
|
{
|
||||||
unsigned int num_advances = plan->num_output_glyphs ();
|
unsigned int num_advances = plan->num_output_glyphs ();
|
||||||
unsigned int last_advance = _advance_for_new_gid (plan,
|
hb_codepoint_t old_gid = 0;
|
||||||
num_advances - 1);
|
unsigned int last_advance = plan->old_gid_for_new_gid (num_advances - 1, &old_gid) ? get_advance (old_gid) : 0;
|
||||||
while (num_advances > 1 &&
|
while (num_advances > 1 &&
|
||||||
last_advance == _advance_for_new_gid (plan,
|
last_advance == (plan->old_gid_for_new_gid (num_advances - 2, &old_gid) ? get_advance (old_gid) : 0))
|
||||||
num_advances - 2))
|
|
||||||
{
|
{
|
||||||
num_advances--;
|
num_advances--;
|
||||||
}
|
}
|
||||||
|
@ -274,17 +273,6 @@ struct hmtxvmtx
|
||||||
return num_advances;
|
return num_advances;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
unsigned int _advance_for_new_gid (const hb_subset_plan_t *plan,
|
|
||||||
hb_codepoint_t new_gid) const
|
|
||||||
{
|
|
||||||
hb_codepoint_t old_gid;
|
|
||||||
if (!plan->old_gid_for_new_gid (new_gid, &old_gid))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return get_advance (old_gid);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned int num_metrics;
|
unsigned int num_metrics;
|
||||||
unsigned int num_advances;
|
unsigned int num_advances;
|
||||||
|
|
Loading…
Reference in New Issue