aboutsummaryrefslogtreecommitdiffstats
path: root/include/pango.h
diff options
context:
space:
mode:
authorLibravatar Heghedus Razvan <heghedus.razvan@protonmail.com>2018-05-07 19:30:45 +0300
committerLibravatar Heghedus Razvan <heghedus.razvan@gmail.com>2018-05-13 17:53:45 +0300
commit789a877b379cd35c350610be62b971ae00feb542 (patch)
tree417eb755118e7dedae3badeeaa7d713f204994e2 /include/pango.h
parentMerge pull request #1824 from snaggen/idle (diff)
downloadsway-789a877b379cd35c350610be62b971ae00feb542.tar.gz
sway-789a877b379cd35c350610be62b971ae00feb542.tar.zst
sway-789a877b379cd35c350610be62b971ae00feb542.zip
Fix crash when using pango markup font
The characters & < > ' " needs to be escaped when using pango markup Signed-off-by: Heghedus Razvan <heghedus.razvan@gmail.com>
Diffstat (limited to 'include/pango.h')
-rw-r--r--include/pango.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/pango.h b/include/pango.h
index f6325f28..d8263f9e 100644
--- a/include/pango.h
+++ b/include/pango.h
@@ -6,6 +6,17 @@
6#include <cairo/cairo.h> 6#include <cairo/cairo.h>
7#include <pango/pangocairo.h> 7#include <pango/pangocairo.h>
8 8
9/* Utility function which escape characters a & < > ' ".
10 *
11 * If the dest parameter is NULL, then the function returns the length of
12 * of the escaped src string. The dest_length doesn't matter.
13 *
14 * If the dest parameter is not NULL then the fuction escapes the src string
15 * an puts the escaped string in dest and returns the lenght of the escaped string.
16 * The dest_length parameter is the size of dest array. If the size of dest is not
17 * enough, then the function returns -1.
18 */
19int escape_markup_text(const char *src, char *dest, int dest_length);
9PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, 20PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
10 const char *text, int32_t scale, bool markup); 21 const char *text, int32_t scale, bool markup);
11void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, 22void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,