From 8fb4932597eba2521a2e575dc0cd6cd174716e4e Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Sun, 12 Sep 2021 16:29:56 +1000 Subject: Round up ascent and descent of fonts on GTK to make it more likely that underscores and accents will be visible. --- gtk/PlatGTK.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 7a53bc28e..4beb1c418 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1073,7 +1073,7 @@ XYPOSITION SurfaceImpl::Ascent(const Font *font_) { if (PFont(font_)->pfd) { PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, PFont(font_)->pfd, pango_context_get_language(pcontext)); - ascent = std::round(floatFromPangoUnits( + ascent = std::ceil(floatFromPangoUnits( pango_font_metrics_get_ascent(metrics))); pango_font_metrics_unref(metrics); } @@ -1087,7 +1087,7 @@ XYPOSITION SurfaceImpl::Descent(const Font *font_) { if (PFont(font_)->pfd) { PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, PFont(font_)->pfd, pango_context_get_language(pcontext)); - const XYPOSITION descent = std::round(floatFromPangoUnits( + const XYPOSITION descent = std::ceil(floatFromPangoUnits( pango_font_metrics_get_descent(metrics))); pango_font_metrics_unref(metrics); return descent; -- cgit v1.2.3