From 7db7214047672fa822ad207166df50218e9a433e Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 1 May 2020 15:35:36 +1000 Subject: Bug [#2173]. Tweak font measurement so underscores more likely visible. --- gtk/PlatGTK.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index ba3493948..7857ece73 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -931,7 +931,7 @@ XYPOSITION SurfaceImpl::Ascent(Font &font_) { if (PFont(font_)->pfd) { PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, PFont(font_)->pfd, pango_context_get_language(pcontext)); - ascent = std::floor(floatFromPangoUnits( + ascent = std::round(floatFromPangoUnits( pango_font_metrics_get_ascent(metrics))); pango_font_metrics_unref(metrics); } @@ -947,7 +947,7 @@ XYPOSITION SurfaceImpl::Descent(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::floor(floatFromPangoUnits( + const XYPOSITION descent = std::round(floatFromPangoUnits( pango_font_metrics_get_descent(metrics))); pango_font_metrics_unref(metrics); return descent; -- cgit v1.2.3