summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-09-08 00:36:47 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-09-08 00:36:47 +0000
commit666164406b0e6bda12d7b82b9edf5f8aff43b001 (patch)
tree82e66be8d63d526471480bcdfb24d1aa7a48f0c9
parenteb973b9bdfd11467f63f1626f16d5d4005eb82a7 (diff)
parent1724333e6a8bb0c267b7f201ea2c3a891d2916c2 (diff)
downloadpango-666164406b0e6bda12d7b82b9edf5f8aff43b001.tar.gz
Merge branch 'layout-font-scale' into 'main'
layout: Fix line height computations Closes #691 See merge request GNOME/pango!637
-rw-r--r--pango/pango-layout.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 065f85a1..a1c47203 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -5695,21 +5695,26 @@ pango_layout_run_get_extents_and_height (PangoLayoutRun *run,
if (pango_analysis_get_size_font (&run->item->analysis))
{
PangoFontMetrics *height_metrics;
+ double xscale, yscale;
height_metrics = pango_font_get_metrics (pango_analysis_get_size_font (&run->item->analysis),
run->item->analysis.language);
- *height = pango_font_metrics_get_height (height_metrics);
+ pango_font_get_scale_factors (pango_analysis_get_size_font (&run->item->analysis), &xscale, &yscale);
+ *height = pango_font_metrics_get_height (height_metrics) * MAX (xscale, yscale);
pango_font_metrics_unref (height_metrics);
}
else
{
+ double xscale, yscale;
+
if (!metrics)
metrics = pango_font_get_metrics (run->item->analysis.font,
run->item->analysis.language);
- *height = pango_font_metrics_get_height (metrics);
+ pango_font_get_scale_factors (run->item->analysis.font, &xscale, &yscale);
+ *height = pango_font_metrics_get_height (metrics) * MAX (xscale, yscale);
}
}