/* Convert from font-space to user-space */
- inline hb_position_t scale_x (int16_t v) { return scale (v, this->x_scale); }
- inline hb_position_t scale_y (int16_t v) { return scale (v, this->y_scale); }
+ inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, this->x_scale); }
+ inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, this->y_scale); }
private:
- inline hb_position_t scale (int16_t v, int scale) { return v * (int64_t) scale / this->face->upem; }
+ inline hb_position_t em_scale (int16_t v, int scale) { return v * (int64_t) scale / this->face->upem; }
};
private:
inline int get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const
{
- return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->scale_x (coordinate) : font->scale_y (coordinate);
+ return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate);
}
inline bool sanitize (hb_sanitize_context_t *c) {
inline int get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const
{
return HB_DIRECTION_IS_HORIZONTAL (direction) ?
- font->scale_x (coordinate) + (this+deviceTable).get_x_delta (font) :
- font->scale_y (coordinate) + (this+deviceTable).get_y_delta (font);
+ font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font) :
+ font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font);
}
inline bool sanitize (hb_sanitize_context_t *c) {
if (!format) return;
/* design units -> fractional pixel */
- if (format & xPlacement) glyph_pos.x_offset += font->scale_x (get_short (values++));
- if (format & yPlacement) glyph_pos.y_offset += font->scale_y (get_short (values++));
- if (format & xAdvance) glyph_pos.x_advance += font->scale_x (get_short (values++));
- if (format & yAdvance) glyph_pos.y_advance += font->scale_y (get_short (values++));
+ if (format & xPlacement) glyph_pos.x_offset += font->em_scale_x (get_short (values++));
+ if (format & yPlacement) glyph_pos.y_offset += font->em_scale_y (get_short (values++));
+ if (format & xAdvance) glyph_pos.x_advance += font->em_scale_x (get_short (values++));
+ if (format & yAdvance) glyph_pos.y_advance += font->em_scale_y (get_short (values++));
if (!has_device ()) return;
inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id HB_UNUSED,
hb_position_t *x, hb_position_t *y) const
{
- *x = font->scale_x (xCoordinate);
- *y = font->scale_y (yCoordinate);
+ *x = font->em_scale_x (xCoordinate);
+ *y = font->em_scale_y (yCoordinate);
}
inline bool sanitize (hb_sanitize_context_t *c) {
if (x_ppem || y_ppem)
ret = hb_font_get_contour_point (font, anchorPoint, glyph_id, &cx, &cy);
- *x = x_ppem && ret ? cx : font->scale_x (xCoordinate);
- *y = y_ppem && ret ? cy : font->scale_y (yCoordinate);
+ *x = x_ppem && ret ? cx : font->em_scale_x (xCoordinate);
+ *y = y_ppem && ret ? cy : font->em_scale_y (yCoordinate);
}
inline bool sanitize (hb_sanitize_context_t *c) {
inline void get_anchor (hb_font_t *font, hb_codepoint_t glyph_id HB_UNUSED,
hb_position_t *x, hb_position_t *y) const
{
- *x = font->scale_x (xCoordinate);
- *y = font->scale_y (yCoordinate);
+ *x = font->em_scale_x (xCoordinate);
+ *y = font->em_scale_y (yCoordinate);
/* pixel -> fractional pixel */
if (font->x_ppem)