diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-10 19:00:09 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-10 19:00:09 +0100 |
| commit | 8dcd121d44f1b5041c83081277e2633745fa376d (patch) | |
| tree | 587a1a5112a5aa447c3f9116e4d42f33f5c4a840 /src | |
| parent | 234a33c12f168a38720578a3040d00b0e63f070b (diff) | |
Text positioning different in 1.4.x vs 1.3.x (#568) - cont'd
@wcout reports that we get better results if function pango_font_metrics_get_height()
is not used until version 1.50.6 and above of libpango. The difference is specially visible
with underscore characters in unscaled, standard DPI displays. This commit does that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx index c05456861..577ee0930 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx @@ -1135,7 +1135,15 @@ Fl_Cairo_Font_Descriptor::Fl_Cairo_Font_Descriptor(const char* name, Fl_Fontsize PangoFontMetrics *metrics = pango_fontset_get_metrics(fontset); ascent = pango_font_metrics_get_ascent(metrics); descent = pango_font_metrics_get_descent(metrics); -#if PANGO_VERSION_CHECK(1,44,0) +/* Function pango_font_metrics_get_height() giving the line height of a pango font + appears with pango version 1.44. However, with pango version 1.48.10 and below, + this function gives values that make the underscore invisible on lowdpi display + and at 100% scaling (the underscore becomes visible starting at 120% scaling). + With pango version 1.50.6 (Ubuntu 22.04) this problem disappears. + Consequently, function pango_font_metrics_get_height() is not used until version 1.50.6 +*/ +//#if PANGO_VERSION_CHECK(1,44,0) +#if PANGO_VERSION_CHECK(1,50,6) line_height = pango_font_metrics_get_height(metrics); // 1.44 #else line_height = (pango_font_metrics_get_ascent(metrics) + pango_font_metrics_get_descent(metrics)) * 1.025 + 0.5; |
