[gvar] Take coords in instead of font in apply_deltas_to_points

This commit is contained in:
Behdad Esfahbod 2022-12-09 18:35:30 -07:00
parent 3caa42a4a7
commit 8e46870093
2 changed files with 6 additions and 4 deletions

View File

@ -276,7 +276,9 @@ struct Glyph
}
#ifndef HB_NO_VAR
glyf_accelerator.gvar->apply_deltas_to_points (gid, font, points.as_array ());
glyf_accelerator.gvar->apply_deltas_to_points (gid,
hb_array (font->coords, font->num_coords),
points.as_array ());
#endif
// mainly used by CompositeGlyph calculating new X/Y offset value so no need to extend it

View File

@ -548,10 +548,11 @@ struct gvar
{ return (i >= end) ? start : (i + 1); }
public:
bool apply_deltas_to_points (hb_codepoint_t glyph, hb_font_t *font,
bool apply_deltas_to_points (hb_codepoint_t glyph,
hb_array_t<int> coords,
const hb_array_t<contour_point_t> points) const
{
if (!font->num_coords) return true;
if (!coords) return true;
if (unlikely (glyph >= table->glyphCount)) return true;
@ -578,7 +579,6 @@ struct gvar
if (points.arrayZ[i].is_end_point)
end_points.push (i);
auto coords = hb_array (font->coords, font->num_coords);
unsigned num_coords = table->axisCount;
hb_array_t<const F2DOT14> shared_tuples = (table+table->sharedTuples).as_array (table->sharedTupleCount * table->axisCount);