mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Fix "Blurry fonts with cairo/pango on FLTK >= 1.4" (#1365)
This commit is contained in:
@@ -1340,7 +1340,7 @@ void Fl_Cairo_Graphics_Driver::draw(const char* str, int n, float x, float y) {
|
|||||||
if (!n) return;
|
if (!n) return;
|
||||||
cairo_save(cairo_);
|
cairo_save(cairo_);
|
||||||
Fl_Cairo_Font_Descriptor *fd = (Fl_Cairo_Font_Descriptor*)font_descriptor();
|
Fl_Cairo_Font_Descriptor *fd = (Fl_Cairo_Font_Descriptor*)font_descriptor();
|
||||||
cairo_translate(cairo_, x - 1, y - (fd->line_height - fd->descent) / float(PANGO_SCALE) - 1);
|
cairo_translate(cairo_, x - 1.5, y - (fd->line_height - fd->descent) / float(PANGO_SCALE) - 1.5);
|
||||||
str = clean_utf8(str, n);
|
str = clean_utf8(str, n);
|
||||||
pango_layout_set_text(pango_layout_, str, n);
|
pango_layout_set_text(pango_layout_, str, n);
|
||||||
pango_cairo_show_layout(cairo_, pango_layout_); // 1.1O
|
pango_cairo_show_layout(cairo_, pango_layout_); // 1.1O
|
||||||
|
|||||||
Reference in New Issue
Block a user