aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2021-09-12 16:29:56 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2021-09-12 16:29:56 +1000
commit8fb4932597eba2521a2e575dc0cd6cd174716e4e (patch)
tree8d799776b025a96b53109e70ff708a82956258bf
parent7b05041875e7ac18f20ecdbc682bd92d759b4b75 (diff)
downloadscintilla-mirror-8fb4932597eba2521a2e575dc0cd6cd174716e4e.tar.gz
Round up ascent and descent of fonts on GTK to make it more likely that
underscores and accents will be visible.
-rwxr-xr-xgtk/PlatGTK.cxx4
1 files 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;