diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-01-29 01:41:56 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-01-29 01:41:56 +0000 |
commit | 1635d9fb78274669380a4514c5a7e3568c4482c3 (patch) | |
tree | 8ab2ad2632e363b08779c40f7d0e7f8db5c8aeb0 | |
parent | b005cd0bbd3e5dd1d4c2ffe2bf7b98754bdaec86 (diff) | |
parent | 20fb155e8c360b0c84f3115e6fd7b32fbea130e9 (diff) | |
download | gtk+-1635d9fb78274669380a4514c5a7e3568c4482c3.tar.gz |
Merge branch 'pango-glyph-positions' into 'master'
Tell pango not to round glyph positions
See merge request GNOME/gtk!2058
-rw-r--r-- | gsk/gl/gskglglyphcache.c | 6 | ||||
-rw-r--r-- | gsk/gskrendernodeparser.c | 12 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c index b147dcef21..9cff7d7ca1 100644 --- a/gsk/gl/gskglglyphcache.c +++ b/gsk/gl/gskglglyphcache.c @@ -149,10 +149,10 @@ render_glyph (GlyphCacheKey *key, glyph_info.glyph = key->data.glyph; glyph_info.geometry.width = value->draw_width * 1024; if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG) - glyph_info.geometry.x_offset = 0; + glyph_info.geometry.x_offset = 250 * key->data.xshift; else - glyph_info.geometry.x_offset = - value->draw_x * 1024; - glyph_info.geometry.y_offset = - value->draw_y * 1024; + glyph_info.geometry.x_offset = 250 * key->data.xshift - value->draw_x * 1024; + glyph_info.geometry.y_offset = 250 * key->data.yshift - value->draw_y * 1024; glyph_string.num_glyphs = 1; glyph_string.glyphs = &glyph_info; diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index 90183482f2..c53597732d 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -689,14 +689,16 @@ create_ascii_glyphs (PangoFont *font) for (i = MIN_ASCII_GLYPH; i < MAX_ASCII_GLYPH; i++) { const char text[2] = { i, 0 }; + PangoShapeFlags flags = 0; - pango_shape_with_flags (text, - 1, - text, - 1, + if (cairo_version () < CAIRO_VERSION_ENCODE (1, 17, 4)) + flags = PANGO_SHAPE_ROUND_POSITIONS; + + pango_shape_with_flags (text, 1, + text, 1, ¬_a_hack, glyph_string, - PANGO_SHAPE_ROUND_POSITIONS); + flags); if (glyph_string->num_glyphs != 1) { diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 3168091367..cddb261e47 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -6305,9 +6305,11 @@ update_pango_context (GtkWidget *widget, font_desc = gtk_css_style_get_pango_font (style); pango_context_set_font_description (context, font_desc); - pango_font_description_free (font_desc); + if (cairo_version () >= CAIRO_VERSION_ENCODE (1, 17, 4)) + pango_context_set_round_glyph_positions (context, FALSE); + pango_context_set_base_dir (context, _gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL); |