diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-11-17 00:39:59 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-11-17 00:39:59 +0000 |
commit | 88ffeea0dacce23fd92a84ebc41ed8af82d75ac6 (patch) | |
tree | 3ffe966a47537d26995b07a7398f80cb8c87229a | |
parent | dc5bde2a20cbb025c9d0ed29ed687740a4d027da (diff) | |
parent | 81f8a47df61f1df9ca82a08813c022150e7d96aa (diff) | |
download | pango-88ffeea0dacce23fd92a84ebc41ed8af82d75ac6.tar.gz |
Merge branch 'backport-620' into 'pango-1-48'
Backport fix for #620 - Fix advance widths with transforms
See merge request GNOME/pango!510
-rw-r--r-- | pango/pangofc-shape.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c index 0a5ce7f9..460635e8 100644 --- a/pango/pangofc-shape.c +++ b/pango/pangofc-shape.c @@ -207,16 +207,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 @@ -226,16 +221,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 @@ -246,22 +236,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 * |