From cb0c4d6e884d805c53ca6e75e8a8a78b681a57e2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 3 Nov 2024 20:10:04 -0500 Subject: [PATCH] rendernodeparser: Use advance width for glyphs Commit f5159e1ecb8b introduced more flexible ways of specifying glyph strings in node files, but it used ink rect width instead of the more appropriate advance width when reconstrucing the glyph string. Fix expected output of one test to match. --- gsk/gskrendernodeparser.c | 6 +++--- testsuite/gsk/nodeparser/text.ref.node | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index 12d7fcfcd0..fd635aa1b4 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -2638,11 +2638,11 @@ unpack_glyphs (PangoFont *font, } else { - PangoRectangle ink_rect; + PangoRectangle rect; - pango_font_get_glyph_extents (font, gi->glyph, &ink_rect, NULL); + pango_font_get_glyph_extents (font, gi->glyph, NULL, &rect); - gi->geometry.width = ink_rect.width; + gi->geometry.width = rect.width; } } diff --git a/testsuite/gsk/nodeparser/text.ref.node b/testsuite/gsk/nodeparser/text.ref.node index 2b033bb81b..c94fa4ef56 100644 --- a/testsuite/gsk/nodeparser/text.ref.node +++ b/testsuite/gsk/nodeparser/text.ref.node @@ -1,6 +1,6 @@ text { color: rgb(50,50,50); font: "Cantarell 14px"; - glyphs: "N", 430 4.2002, 406 6.10352, 417 7, 772 4, 783 5, 783 5, 793 6 0 0 same-cluster; + glyphs: "Ntp", 417 7, 772 4, 783 5, 783 5, 793 6 0 0 same-cluster; offset: 0 32.0186; }