diff options
author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2022-07-01 12:23:04 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-07-01 13:05:58 +0200 |
commit | 80e386fd97c0da00970f0acc007574151048cfbf (patch) | |
tree | df11d53184b20e3f1afe86b8272420349fd9b552 /sway | |
parent | 75605491a54f8647740fdba75dd2ad7bae9e0ca7 (diff) | |
download | sway-80e386fd97c0da00970f0acc007574151048cfbf.tar.xz |
Reuse parsed PangoFontDescription
Avoids parsing the configured font each time text is rendered.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/container.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 09766ce5..04ef965f 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -520,7 +520,7 @@ static void render_titlebar_text_texture(struct sway_output *output, to_cairo_subpixel_order(output->wlr_output->subpixel)); } cairo_set_font_options(c, fo); - get_text_size(c, config->font, &width, NULL, &baseline, scale, + get_text_size(c, config->font_description, &width, NULL, &baseline, scale, config->pango_markup, "%s", text); cairo_surface_destroy(dummy_surface); cairo_destroy(c); @@ -554,7 +554,7 @@ static void render_titlebar_text_texture(struct sway_output *output, class->text[2], class->text[3]); cairo_move_to(cairo, 0, config->font_baseline * scale - baseline); - render_text(cairo, config->font, scale, pango_markup, "%s", text); + render_text(cairo, config->font_description, scale, pango_markup, "%s", text); cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); |