aboutsummaryrefslogtreecommitdiffstats
path: root/include/pango.h
diff options
context:
space:
mode:
authorLibravatar Hugo Osvaldo Barrera <hugo@barrera.io>2022-06-29 21:38:24 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2022-07-01 13:05:58 +0200
commit75605491a54f8647740fdba75dd2ad7bae9e0ca7 (patch)
treef1d7476fbc893517ea01ed0f92841219f8b4808a /include/pango.h
parentAvoid unecessary string copy (diff)
downloadsway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.tar.gz
sway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.tar.zst
sway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.zip
Reject font values that are invalid for pango
Use pango to parse font configuration early, and reject the command as invalid if the value is invalid for pango. Since we're already parsing the font into a `PangoFontDescription`, keep that instance around and avoid re-parsing the font each time we render text. Fixes: https://github.com/swaywm/sway/issues/6805
Diffstat (limited to 'include/pango.h')
-rw-r--r--include/pango.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/pango.h b/include/pango.h
index 93affc23..2f14d2bb 100644
--- a/include/pango.h
+++ b/include/pango.h
@@ -17,7 +17,7 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
17 const char *text, double scale, bool markup); 17 const char *text, double scale, bool markup);
18void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, 18void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
19 int *baseline, double scale, bool markup, const char *fmt, ...); 19 int *baseline, double scale, bool markup, const char *fmt, ...);
20void get_text_metrics(const char *font, int *height, int *baseline); 20void get_text_metrics(const PangoFontDescription *font, int *height, int *baseline);
21void render_text(cairo_t *cairo, const char *font, 21void render_text(cairo_t *cairo, const char *font,
22 double scale, bool markup, const char *fmt, ...); 22 double scale, bool markup, const char *fmt, ...);
23 23