[font] Add em_scaleff() that returns float

This commit is contained in:
Behdad Esfahbod 2022-02-02 15:42:33 -06:00
parent dd7b6e2c3f
commit 6c0b65a6a8
1 changed files with 3 additions and 1 deletions

View File

@ -625,7 +625,9 @@ struct hb_font_t
hb_position_t em_mult (int16_t v, int64_t mult) hb_position_t em_mult (int16_t v, int64_t mult)
{ return (hb_position_t) ((v * mult + 32768) >> 16); } { return (hb_position_t) ((v * mult + 32768) >> 16); }
hb_position_t em_scalef (float v, int scale) hb_position_t em_scalef (float v, int scale)
{ return (hb_position_t) roundf (v * scale / face->get_upem ()); } { return (hb_position_t) roundf (em_fscalef (v, scale)); }
float em_fscalef (float v, int scale)
{ return v * scale / face->get_upem (); }
float em_fscale (int16_t v, int scale) float em_fscale (int16_t v, int scale)
{ return (float) v * scale / face->get_upem (); } { return (float) v * scale / face->get_upem (); }
}; };