[pango/glyph-extents-fixes: 3/5] cairo: fix hinting of metrics




commit 6b260a686b2c46237cb2673f23de163b252192bc
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 30 20:45:12 2021 -0400

    cairo: fix hinting of metrics
    
    We were looking at the wrong font options here,
    causing metrics to not be hinted when they should
    be. This was causing some of the empty line height
    tests to fail.

 pango/pangocairo-fcfont.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 85cc45c8..4453b5ab 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -75,14 +75,13 @@ static PangoFontMetrics *
 pango_cairo_fc_font_create_base_metrics_for_context (PangoCairoFont *cfont,
                                                     PangoContext   *context)
 {
-  PangoFcFont *fcfont = (PangoFcFont *) (cfont);
+  PangoCairoFcFont *cffont = (PangoCairoFcFont *) cfont;
+  PangoFcFont *fcfont = (PangoFcFont *) cfont;
   PangoFontMetrics *metrics;
-  const cairo_font_options_t *options;
 
   metrics = pango_fc_font_create_base_metrics_for_context (fcfont, context);
 
-  options = pango_cairo_context_get_font_options (context);
-  if (cairo_font_options_get_hint_metrics (options) == CAIRO_HINT_METRICS_ON)
+  if (_pango_cairo_font_private_is_metrics_hinted (&cffont->cf_priv))
     {
       metrics->ascent = PANGO_PIXELS_CEIL (metrics->ascent) * PANGO_SCALE;
       metrics->descent = PANGO_PIXELS_CEIL (metrics->descent) * PANGO_SCALE;


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