|
|
commit 170a9d8e1fc00e55a2a9a13abc16107cbcecded0
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu May 5 12:20:24 2022 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu May 5 12:20:24 2022 +0200
Approximate result of pango_font_metrics_get_height() for Pango < 1.44
src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index 8292906..9c5d829 100644
--- src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
@@ -1051,7 +1051,7 @@ Fl_Cairo_Font_Descriptor::Fl_Cairo_Font_Descriptor(const char* name, Fl_Fontsize
#if PANGO_VERSION_CHECK(1,44,0)
line_height = ceil(pango_font_metrics_get_height(metrics)/double(PANGO_SCALE)); // 1.44
#else
- line_height = int(size * 1.3 + 0.5); // TO IMPROVE
+ line_height = int( (pango_font_metrics_get_ascent(metrics) + pango_font_metrics_get_descent(metrics)) * 1.025 / PANGO_SCALE + 0.5);
#endif
q_width = pango_font_metrics_get_approximate_char_width(metrics)/PANGO_SCALE;
pango_font_metrics_unref(metrics);
[ Direct Link to Message ] | |
|
| |