diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-02-21 02:16:29 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-02-21 02:16:29 +0000 |
commit | b2ef315e71142bed38b65d1186fb4c16d640048e (patch) | |
tree | 9c92f54805630cfa29bdcf99f118fd36dbfab49c /pango/pangocairo-font.c | |
parent | 8e506ba769cc8cc356d61f090f71bbb1a3b12037 (diff) | |
parent | edc0886df60741ecd3704c1df5f1f9fd2469c13e (diff) | |
download | pango-b2ef315e71142bed38b65d1186fb4c16d640048e.tar.gz |
Merge branch 'fix-underline-scale' into 'main'
cairo: Don't mis-scale metrics
Closes #730
See merge request GNOME/pango!680
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r-- | pango/pangocairo-font.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index 598065c0..24bb325b 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -248,9 +248,6 @@ _pango_cairo_font_get_metrics (PangoFont *font, PangoRectangle extents; PangoFontDescription *desc; cairo_scaled_font_t *scaled_font; - cairo_matrix_t cairo_matrix; - PangoMatrix pango_matrix; - PangoMatrix identity = PANGO_MATRIX_INIT; glong sample_str_width; int height, shift; @@ -279,32 +276,6 @@ _pango_cairo_font_get_metrics (PangoFont *font, info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_base_metrics_for_context) (cfont, context); - /* We now need to adjust the base metrics for ctm */ - cairo_scaled_font_get_ctm (scaled_font, &cairo_matrix); - pango_matrix.xx = cairo_matrix.xx; - pango_matrix.yx = cairo_matrix.yx; - pango_matrix.xy = cairo_matrix.xy; - pango_matrix.yy = cairo_matrix.yy; - pango_matrix.x0 = 0; - pango_matrix.y0 = 0; - if (G_UNLIKELY (0 != memcmp (&identity, &pango_matrix, 4 * sizeof (double)))) - { - double xscale = pango_matrix_get_font_scale_factor (&pango_matrix); - if (xscale) xscale = 1 / xscale; - - info->metrics->ascent *= xscale; - info->metrics->descent *= xscale; - info->metrics->height *= xscale; - info->metrics->underline_position *= xscale; - info->metrics->underline_thickness *= xscale; - info->metrics->strikethrough_position *= xscale; - info->metrics->strikethrough_thickness *= xscale; - } - - /* Set the matrix on the context so we don't have to adjust the derived - * metrics. */ - pango_context_set_matrix (context, &pango_matrix); - /* Ugly. We need to prevent recursion when we call into * PangoLayout to determine approximate char width. */ |