diff options
author | 2016-09-08 15:50:00 -0400 | |
---|---|---|
committer | 2016-09-08 15:50:00 -0400 | |
commit | 40013029ea81646d3c8e2c7674692555f88bf885 (patch) | |
tree | 0cbd656e90e093225b78de33b071e1d2a901aca2 /wayland/pango.c | |
parent | Merge pull request #885 from zandrmartin/commands-refactor (diff) | |
parent | fix pango markup on swaybar (diff) | |
download | sway-40013029ea81646d3c8e2c7674692555f88bf885.tar.gz sway-40013029ea81646d3c8e2c7674692555f88bf885.tar.zst sway-40013029ea81646d3c8e2c7674692555f88bf885.zip |
Merge pull request #888 from zandrmartin/swaybar-pango-fix
fix pango markup on swaybar
Diffstat (limited to 'wayland/pango.c')
-rw-r--r-- | wayland/pango.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wayland/pango.c b/wayland/pango.c index ac090c9a..38993243 100644 --- a/wayland/pango.c +++ b/wayland/pango.c | |||
@@ -11,12 +11,13 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text | |||
11 | int32_t scale, bool markup) { | 11 | int32_t scale, bool markup) { |
12 | PangoLayout *layout = pango_cairo_create_layout(cairo); | 12 | PangoLayout *layout = pango_cairo_create_layout(cairo); |
13 | PangoAttrList *attrs = pango_attr_list_new(); | 13 | PangoAttrList *attrs = pango_attr_list_new(); |
14 | pango_attr_list_insert(attrs, pango_attr_scale_new(scale)); | ||
15 | if (markup) { | 14 | if (markup) { |
15 | pango_parse_markup(text, -1, 0, &attrs, NULL, NULL, NULL); | ||
16 | pango_layout_set_markup(layout, text, -1); | 16 | pango_layout_set_markup(layout, text, -1); |
17 | } else { | 17 | } else { |
18 | pango_layout_set_text(layout, text, -1); | 18 | pango_layout_set_text(layout, text, -1); |
19 | } | 19 | } |
20 | pango_attr_list_insert(attrs, pango_attr_scale_new(scale)); | ||
20 | PangoFontDescription *desc = pango_font_description_from_string(font); | 21 | PangoFontDescription *desc = pango_font_description_from_string(font); |
21 | pango_layout_set_font_description(layout, desc); | 22 | pango_layout_set_font_description(layout, desc); |
22 | pango_layout_set_single_paragraph_mode(layout, 1); | 23 | pango_layout_set_single_paragraph_mode(layout, 1); |