summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-02 11:32:29 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-03-02 11:32:29 -0500
commit96ac85038bdf893a1d60ed0255c4031d0a881e22 (patch)
treeed3229e1dc15856ba9c72562919bebe0f3ef90ee
parent69f051798eb86664af8a7907c68e588c896c9261 (diff)
downloadgtk+-fix-glyph-serialization.tar.gz
rendernode: Fix glyph serializationfix-glyph-serialization
We serializing to a string of ASCII, we need to escape some chars, such as '\' and '"'. Fixes: #3710
-rw-r--r--gsk/gskrendernodeparser.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index c53597732d..8d72f94aa1 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -2338,7 +2338,18 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
glyphs[i].geometry.y_offset == 0 &&
glyphs[i].attr.is_cluster_start)
{
- g_string_append_c (str, j + MIN_ASCII_GLYPH);
+ switch (j + MIN_ASCII_GLYPH)
+ {
+ case '\\':
+ g_string_append (str, "\\\\");
+ break;
+ case '"':
+ g_string_append (str, "\\\"");
+ break;
+ default:
+ g_string_append_c (str, j + MIN_ASCII_GLYPH);
+ break;
+ }
break;
}
else if (glyphs[i].glyph == ascii->glyphs[j].glyph)