[pango/simple-fontmap: 10/23] Make logical glyph extents better




commit fe1c54b984a92d8b82a3fdb9bc88716f17e81be3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 31 00:07:52 2021 -0400

    Make logical glyph extents better
    
    For east and west gravity, the logical glyph extents
    were still misaligned with the ink extents.

 pango/pangocairo-font.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 503f863b..597a320d 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -934,12 +934,14 @@ _pango_cairo_font_private_get_glyph_extents (PangoCairoFontPrivate *cf_priv,
           break;
         case PANGO_GRAVITY_EAST:
           logical_rect->width = cf_priv->font_extents.height;
+          logical_rect->x = - logical_rect->width;
           break;
         case PANGO_GRAVITY_NORTH:
           logical_rect->width = entry->width;
           break;
         case PANGO_GRAVITY_WEST:
           logical_rect->width = - cf_priv->font_extents.height;
+          logical_rect->x = - logical_rect->width;
           break;
         case PANGO_GRAVITY_AUTO:
         default:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]