[hvar] Minor internal rewiring

Not passing font to functions makes it more clear that they don't
scale values.
This commit is contained in:
Behdad Esfahbod 2022-06-30 14:25:09 -06:00
parent aba4a4957a
commit 13c499cb26
2 changed files with 8 additions and 7 deletions

View File

@ -283,7 +283,7 @@ struct hmtxvmtx
return advances[hb_min (glyph - num_bearings, num_advances - num_bearings - 1)]; return advances[hb_min (glyph - num_bearings, num_advances - num_bearings - 1)];
} }
unsigned int get_advance (hb_codepoint_t glyph, unsigned get_advance (hb_codepoint_t glyph,
hb_font_t *font, hb_font_t *font,
VariationStore::cache_t *store_cache = nullptr) const VariationStore::cache_t *store_cache = nullptr) const
{ {
@ -294,7 +294,9 @@ struct hmtxvmtx
return advance; return advance;
if (var_table.get_length ()) if (var_table.get_length ())
return advance + roundf (var_table->get_advance_var (glyph, font, store_cache)); // TODO Optimize?! return advance + roundf (var_table->get_advance_var (glyph,
font->coords, font->num_coords,
store_cache)); // TODO Optimize?!
return _glyf_get_advance_var (font, glyph, T::tableTag == HB_OT_TAG_vmtx); return _glyf_get_advance_var (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
#else #else

View File

@ -320,13 +320,12 @@ struct HVARVVAR
} }
float get_advance_var (hb_codepoint_t glyph, float get_advance_var (hb_codepoint_t glyph,
hb_font_t *font, const int *coords, unsigned int coord_count,
VariationStore::cache_t *store_cache = nullptr) const VariationStore::cache_t *store_cache = nullptr) const
{ {
uint32_t varidx = (this+advMap).map (glyph); uint32_t varidx = (this+advMap).map (glyph);
return (this+varStore).get_delta (varidx, return (this+varStore).get_delta (varidx,
font->coords, coords, coord_count,
font->num_coords,
store_cache); store_cache);
} }