[glyf/VarComposite] More

This commit is contained in:
Behdad Esfahbod 2022-10-13 17:11:12 -06:00
parent 12688ed386
commit 65cc3b5e2b
1 changed files with 18 additions and 6 deletions

View File

@ -29,6 +29,9 @@ struct VarCompositeGlyphRecord
}; };
public: public:
static constexpr unsigned NUM_TRANSFORM_POINTS = 9;
unsigned int get_size () const unsigned int get_size () const
{ {
unsigned int size = min_size; unsigned int size = min_size;
@ -51,6 +54,21 @@ struct VarCompositeGlyphRecord
bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } bool is_use_my_metrics () const { return flags & USE_MY_METRICS; }
hb_codepoint_t get_gid () const
{
return gid;
}
unsigned get_num_axes () const
{
return num_axes;
}
unsigned get_num_points () const
{
return num_axes + NUM_TRANSFORM_POINTS;
}
void transform_points (contour_point_vector_t &points) const void transform_points (contour_point_vector_t &points) const
{ {
float matrix[4]; float matrix[4];
@ -163,12 +181,6 @@ struct VarCompositeGlyphRecord
translate (matrix, trans, -tCenterX, -tCenterY); translate (matrix, trans, -tCenterX, -tCenterY);
} }
public:
hb_codepoint_t get_gid () const
{
return gid;
}
protected: protected:
HBUINT16 flags; HBUINT16 flags;
HBGlyphID16 gid; HBGlyphID16 gid;