From a6488e4ec7b8163fae0d4d232452b5896937bb6e Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 1 May 2020 15:35:36 +1000 Subject: Backport: Bug [#2173]. Tweak font measurement so underscores more likely visible. Backport of changeset 8219:69ebdfc2513e. --- gtk/PlatGTK.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 680caf081..0ffddbe74 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -923,7 +923,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 = Sci::round(floatFromPangoUnits( pango_font_metrics_get_ascent(metrics))); pango_font_metrics_unref(metrics); } @@ -939,7 +939,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 = Sci::round(floatFromPangoUnits( pango_font_metrics_get_descent(metrics))); pango_font_metrics_unref(metrics); return descent; -- cgit v1.2.3