aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kate <kit-ty-kate@outlook.com>2023-01-04 15:13:53 +0000
committerLibravatar Simon Ser <contact@emersion.fr>2023-02-01 16:23:19 +0100
commit5218c04bc984229cf659d955f1426e7972529edb (patch)
treee306b551ce6f5397a728db477b91e2c9a28a6b0f
parentbuild: bump version to 1.8 (diff)
downloadsway-5218c04bc984229cf659d955f1426e7972529edb.tar.gz
sway-5218c04bc984229cf659d955f1426e7972529edb.tar.zst
sway-5218c04bc984229cf659d955f1426e7972529edb.zip
Allow setting the font size to 0
-rw-r--r--sway/commands/font.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands/font.c b/sway/commands/font.c
index 74bb6b9f..dd80281f 100644
--- a/sway/commands/font.c
+++ b/sway/commands/font.c
@@ -33,10 +33,10 @@ struct cmd_results *cmd_font(int argc, char **argv) {
33 return cmd_results_new(CMD_FAILURE, "Invalid font family."); 33 return cmd_results_new(CMD_FAILURE, "Invalid font family.");
34 } 34 }
35 35
36 const gint size = pango_font_description_get_size(font_description); 36 const PangoFontMask flags = pango_font_description_get_set_fields(font_description);
37 if (size == 0) { 37 if ((flags & PANGO_FONT_MASK_SIZE) == 0) {
38 pango_font_description_free(font_description); 38 pango_font_description_free(font_description);
39 return cmd_results_new(CMD_FAILURE, "Invalid font size."); 39 return cmd_results_new(CMD_FAILURE, "Font size not given.");
40 } 40 }
41 41
42 if (config->font_description != NULL) { 42 if (config->font_description != NULL) {