- /* XXX speed up */
- inline hb_position_t scale_x (int16_t v) { return (int64_t) this->font->x_scale * v / this->face->head_table->get_upem (); }
- inline hb_position_t scale_y (int16_t v) { return (int64_t) this->font->y_scale * v / this->face->head_table->get_upem (); }
+ inline hb_position_t scale_x (int16_t v) { return scale (v, this->font->x_scale); }
+ inline hb_position_t scale_y (int16_t v) { return scale (v, this->font->y_scale); }
+
+ private:
+ inline hb_position_t scale (int16_t v, unsigned int scale) { return v * (int64_t) scale / this->face->head_table->get_upem (); }