From 26858d7b620b667ce1aa8dbc35f5d71f04ccdaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= Date: Wed, 22 Oct 2025 16:19:24 -0300 Subject: [PATCH] Add the option to set horizontal padding --- config.def.h | 2 ++ dwlb.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 131a857..a8ea28b 100644 --- a/config.def.h +++ b/config.def.h @@ -14,6 +14,8 @@ static bool bottom = false; static bool hide_vacant = false; // vertical pixel padding above and below text static uint32_t vertical_padding = 1; +// horizontal pixel padding of the left and right of each character +static uint32_t horizontal_padding = 0; // allow in-line color commands in status text static bool status_commands = true; // center title text diff --git a/dwlb.c b/dwlb.c index faab2d9..e96fa40 100644 --- a/dwlb.c +++ b/dwlb.c @@ -1904,7 +1904,7 @@ main(int argc, char **argv) snprintf(buf, sizeof buf, "dpi=%u", dpi); if (!(font = fcft_from_name(1, (const char *[]) {fontstr}, buf))) DIE("Could not load font"); - textpadding = font->height / 2; + textpadding = (font->height + horizontal_padding) / 2; height = font->height / buffer_scale + vertical_padding * 2; /* Configure tag names */