From 75605491a54f8647740fdba75dd2ad7bae9e0ca7 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Wed, 29 Jun 2022 21:38:24 +0200 Subject: 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 --- include/pango.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/pango.h') 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, const char *text, double scale, bool markup); void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, int *baseline, double scale, bool markup, const char *fmt, ...); -void get_text_metrics(const char *font, int *height, int *baseline); +void get_text_metrics(const PangoFontDescription *font, int *height, int *baseline); void render_text(cairo_t *cairo, const char *font, double scale, bool markup, const char *fmt, ...); -- cgit v1.2.3-54-g00ecf