From b6f902a1a9c8b72b5d6a241a14a7bacfaea3a56a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 May 2011 00:04:15 -0400 Subject: [PATCH] Minor --- src/hb-font-private.hh | 6 +++--- src/hb-ot-layout-gdef-private.hh | 6 +++--- src/hb-ot-layout-gpos-private.hh | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh index bd3000add..203cd238e 100644 --- a/src/hb-font-private.hh +++ b/src/hb-font-private.hh @@ -115,11 +115,11 @@ struct _hb_font_t { /* 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; } }; diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index 52ac0642a..910f32d1a 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -98,7 +98,7 @@ struct CaretValueFormat1 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) { @@ -146,8 +146,8 @@ struct CaretValueFormat3 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) { diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index e8b504612..21c624148 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -105,10 +105,10 @@ struct ValueFormat : USHORT 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; @@ -212,8 +212,8 @@ struct AnchorFormat1 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) { @@ -244,8 +244,8 @@ struct AnchorFormat2 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) { @@ -270,8 +270,8 @@ struct AnchorFormat3 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)