[glyf/VarComposite] Set coordinates

Code is untested but complete!
This commit is contained in:
Behdad Esfahbod committed 2022-12-09 14:45:29 -07:00
1 parent 4ec7781497
commit 7efd68da39
2 files changed
+18 -1

No files matched your search

+2 -1
View File
@@ -356,7 +356,8 @@ struct Glyph
comp_points.reset ();
/* XXX Apply variations. */
coord_setter_t coord_setter (font);
item.set_coordinates (coord_setter, record_points);
if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ())
.get_points (font, glyf_accelerator, comp_points,
+16
View File
@@ -226,6 +226,22 @@ struct VarCompositeGlyphRecord
translate (matrix, trans, -tCenterX, -tCenterY);
}
void set_coordinates (coord_setter_t &setter,
hb_array_t<contour_point_t> axis_points) const
{
unsigned axis_width = (flags & AXIS_INDICES_ARE_SHORT) ? 2 : 1;
const HBUINT8 *p = &StructAfter<const HBUINT8> (num_axes);
const HBUINT16 *q = &StructAfter<const HBUINT16> (num_axes);
unsigned count = num_axes;
for (unsigned i = 0; i < count; i++)
{
unsigned axis_index = axis_width == 1 ? *p++ : *q++;
setter[axis_index] = axis_points[i].x;
}
}
protected:
HBUINT16 flags;
HBGlyphID16 gid;