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 /include/pango.h | |
parent | Reject font values that are invalid for pango (diff) | |
download | sway-80e386fd97c0da00970f0acc007574151048cfbf.tar.gz sway-80e386fd97c0da00970f0acc007574151048cfbf.tar.zst sway-80e386fd97c0da00970f0acc007574151048cfbf.zip |
Reuse parsed PangoFontDescription
Avoids parsing the configured font each time text is rendered.
Diffstat (limited to 'include/pango.h')
-rw-r--r-- | include/pango.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/pango.h b/include/pango.h index 2f14d2bb..1db113c2 100644 --- a/include/pango.h +++ b/include/pango.h | |||
@@ -13,12 +13,12 @@ | |||
13 | * escaped string to dest if provided. | 13 | * escaped string to dest if provided. |
14 | */ | 14 | */ |
15 | size_t escape_markup_text(const char *src, char *dest); | 15 | size_t escape_markup_text(const char *src, char *dest); |
16 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, | 16 | PangoLayout *get_pango_layout(cairo_t *cairo, const PangoFontDescription *desc, |
17 | const char *text, double scale, bool markup); | 17 | const char *text, double scale, bool markup); |
18 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, | 18 | void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width, int *height, |
19 | int *baseline, double scale, bool markup, const char *fmt, ...); | 19 | int *baseline, double scale, bool markup, const char *fmt, ...); |
20 | void get_text_metrics(const PangoFontDescription *font, int *height, int *baseline); | 20 | void get_text_metrics(const PangoFontDescription *desc, int *height, int *baseline); |
21 | void render_text(cairo_t *cairo, const char *font, | 21 | void render_text(cairo_t *cairo, PangoFontDescription *desc, |
22 | double scale, bool markup, const char *fmt, ...); | 22 | double scale, bool markup, const char *fmt, ...); |
23 | 23 | ||
24 | #endif | 24 | #endif |