From 5218c04bc984229cf659d955f1426e7972529edb Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 4 Jan 2023 15:13:53 +0000 Subject: [PATCH] Allow setting the font size to 0 --- sway/commands/font.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sway/commands/font.c b/sway/commands/font.c index 74bb6b9f46..dd80281f42 100644 --- a/sway/commands/font.c +++ b/sway/commands/font.c @@ -33,10 +33,10 @@ struct cmd_results *cmd_font(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "Invalid font family."); } - const gint size = pango_font_description_get_size(font_description); - if (size == 0) { + const PangoFontMask flags = pango_font_description_get_set_fields(font_description); + if ((flags & PANGO_FONT_MASK_SIZE) == 0) { pango_font_description_free(font_description); - return cmd_results_new(CMD_FAILURE, "Invalid font size."); + return cmd_results_new(CMD_FAILURE, "Font size not given."); } if (config->font_description != NULL) {