diff options
Diffstat (limited to 'pango/shape.c')
-rw-r--r-- | pango/shape.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/pango/shape.c b/pango/shape.c index 79489105..52a7aabb 100644 --- a/pango/shape.c +++ b/pango/shape.c @@ -148,16 +148,11 @@ pango_hb_font_get_glyph_h_advance (hb_font_t *font, void *user_data G_GNUC_UNUSED) { PangoHbShapeContext *context = (PangoHbShapeContext *) font_data; + PangoRectangle logical; - if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) - { - PangoRectangle logical; - - pango_font_get_glyph_extents (context->font, glyph, NULL, &logical); - return logical.width; - } + pango_font_get_glyph_extents (context->font, glyph, NULL, &logical); - return hb_font_get_glyph_h_advance (context->parent, glyph); + return logical.width; } static hb_position_t @@ -167,16 +162,11 @@ pango_hb_font_get_glyph_v_advance (hb_font_t *font, void *user_data G_GNUC_UNUSED) { PangoHbShapeContext *context = (PangoHbShapeContext *) font_data; + PangoRectangle logical; - if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) - { - PangoRectangle logical; - - pango_font_get_glyph_extents (context->font, glyph, NULL, &logical); - return logical.height; - } + pango_font_get_glyph_extents (context->font, glyph, NULL, &logical); - return hb_font_get_glyph_v_advance (context->parent, glyph); + return logical.height; } static hb_bool_t @@ -187,22 +177,16 @@ pango_hb_font_get_glyph_extents (hb_font_t *font, void *user_data G_GNUC_UNUSED) { PangoHbShapeContext *context = (PangoHbShapeContext *) font_data; + PangoRectangle ink; - if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) - { - PangoRectangle ink; - - pango_font_get_glyph_extents (context->font, glyph, &ink, NULL); + pango_font_get_glyph_extents (context->font, glyph, &ink, NULL); - extents->x_bearing = ink.x; - extents->y_bearing = ink.y; - extents->width = ink.width; - extents->height = ink.height; - - return TRUE; - } + extents->x_bearing = ink.x; + extents->y_bearing = ink.y; + extents->width = ink.width; + extents->height = ink.height; - return hb_font_get_glyph_extents (context->parent, glyph, extents); + return TRUE; } static hb_font_t * |