summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-02-17 18:30:57 -0500
committerMatthias Clasen <mclasen@redhat.com>2023-02-17 19:27:44 -0500
commit60beaf2e3aa27e50fabc5f15df331c1aa147a659 (patch)
treeed55fee5a6d991857fff410456833d198e149b5c
parent13cd53498bff11c80f993c6aa42db9a066d81fe0 (diff)
downloadpango-60beaf2e3aa27e50fabc5f15df331c1aa147a659.tar.gz
cairo: Apply hinting to underlines too
When hint-metrics is on, make sure underline and strikethrough position and thickness are in whole pixels. This should help with disappearing mnemonics in GTK widgets.
-rw-r--r--pango/pangocairo-fcfont.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 4453b5ab..02eefb69 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -86,6 +86,10 @@ pango_cairo_fc_font_create_base_metrics_for_context (PangoCairoFont *cfont,
metrics->ascent = PANGO_PIXELS_CEIL (metrics->ascent) * PANGO_SCALE;
metrics->descent = PANGO_PIXELS_CEIL (metrics->descent) * PANGO_SCALE;
metrics->height = PANGO_PIXELS_CEIL (metrics->height) * PANGO_SCALE;
+ metrics->underline_position = PANGO_PIXELS_CEIL (metrics->underline_position) * PANGO_SCALE;
+ metrics->underline_thickness = PANGO_PIXELS_CEIL (metrics->underline_thickness) * PANGO_SCALE;
+ metrics->strikethrough_position = PANGO_PIXELS_CEIL (metrics->strikethrough_position) * PANGO_SCALE;
+ metrics->strikethrough_thickness = PANGO_PIXELS_CEIL (metrics->strikethrough_thickness) * PANGO_SCALE;
}
return metrics;