Merge branch 'pango-glyph-positions' into 'master'

Tell pango not to round glyph positions

See merge request GNOME/gtk!2058
This commit is contained in:
Matthias Clasen 2021-01-29 01:41:56 +00:00
commit 1635d9fb78
3 changed files with 13 additions and 9 deletions

View File

@ -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;

View File

@ -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,
&not_a_hack,
glyph_string,
PANGO_SHAPE_ROUND_POSITIONS);
flags);
if (glyph_string->num_glyphs != 1)
{

View File

@ -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);