summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-29 13:10:40 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-29 13:10:40 +0200
commit1b513d3f00dd42465fd8a067800b2da0b6dcff81 (patch)
tree71161293e845f112c7aed8ccb1027f91c1661636 /src
parenta8da590d114c55c47b6b9d1a780559ce36285c57 (diff)
Fix for issue #438 : Wayland: Textdrawing different from Xft version.
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index cb7e07c9b..4f36bb246 100644
--- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
@@ -1051,7 +1051,7 @@ int Fl_Cairo_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) {
Fl_Cairo_Font_Descriptor::Fl_Cairo_Font_Descriptor(const char* name, Fl_Fontsize size) : Fl_Font_Descriptor(name, size) {
char string[70];
strcpy(string, name);
- sprintf(string + strlen(string), " %d", int(size * 0.7 + 0.5) ); // why reduce size?
+ sprintf(string + strlen(string), " %d", int(size * 0.75 + 0.5) ); // why reduce size?
fontref = pango_font_description_from_string(string);
width = NULL;
static PangoFontMap *def_font_map = pango_cairo_font_map_get_default(); // 1.10
@@ -1122,7 +1122,7 @@ void Fl_Cairo_Graphics_Driver::font(Fl_Font fnum, Fl_Fontsize s) {
void Fl_Cairo_Graphics_Driver::draw(const char* str, int n, float x, float y) {
if (!n) return;
cairo_save(cairo_);
- cairo_translate(cairo_, x, y - height() + descent() -1);
+ cairo_translate(cairo_, x, y - height() + descent() + size()/21.);
pango_layout_set_text(pango_layout_, str, n);
pango_cairo_show_layout(cairo_, pango_layout_);
cairo_restore(cairo_);