[dev] [Bug?] Incorrect font render size, dwm/ dmenu

0 views
Skip to first unread message

zuix

unread,
Nov 26, 2025, 6:49:29 AMNov 26
to Dev
Both `dwm` and `dmenu` render font(s) at incorrect sizes. I've not modified anything related to fonts on my system (no fontconfig edits related to font size). I'm using >96 Xft.dpi in Xresources. The font(s) appear bigger than the specified 10.5pt size (compared with font rendering on `st`, which renders correctly, at the same size).

ovah

unread,
Nov 26, 2025, 1:38:49 PMNov 26
to dev mail list
On 26/11/25 at 12:48pm, zuix wrote:
> Both `dwm` and `dmenu` render font(s) at incorrect sizes. I've not modified anything related to fonts on my system (no fontconfig edits related to font size). I'm using >96 Xft.dpi in Xresources. The font(s) appear bigger than the specified 10.5pt size (compared with font rendering on `st`, which renders correctly, at the same size).
>

Hi friend,

Both dwm and dmenu render fonts at the correct size for me using various
methods to set the font size. If you could share how you are setting
font size I may be able to help you get the sizing correct. The
standards that usually work for me are as follows: setting font face
with predefined size ("Terminus:size=12") or I'm not actually sure what
this method is called but it also works for me
("-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*") and inside of config file
that would be setting *fonts[] or dmenufonts[]. I hope this helps and if
you still need extra help I could try testing the specific size and font
face you are using.

Best,
ovah
signature.asc

zuix

unread,
Nov 27, 2025, 8:28:41 AMNov 27
to dev mail list
Well this is weird, they are rendered at correct sizes now. I could swear i saw them being rendered bigger than the specified size. Perhaps i confused something.

Anyways, testing now i find them being rendered correctly. I'll be on lookout in case i come across the issue again. I had a screenshot which showed the relevant dwm/ dmenu config.h files and the mismatched rendering... which i sadly deleted before testing. But just for the record, these were the sizes that i had used:

// dwm
static const char *fonts[] = { "monospace:size=10.5" };
static const char dmenufont[] = "monospace:size=10.5";
// st
static char *font = "monospace:size=10.5";

If i was not confused/ mistaken then it's likely to be a bug in the relevant font libraries that the tools use. Of course other setup specific/ related factors could also be responsible.
Nov 26, 2025, 18:39 by ad...@ovah.dev:

Страхиња Радић

unread,
Nov 28, 2025, 12:27:41 AMNov 28
to dev mail list
Дана 25/11/27 02:27PM, zuix написа:
> Well this is weird, they are rendered at correct sizes now. I could
> swear i saw them being rendered bigger than the specified size. Perhaps
> i confused something.

Maybe zoom was involved:

https://git.suckless.org/st/file/x.c.html#l296
https://git.suckless.org/st/file/config.def.h.html#l196


Дана 25/11/26 10:37AM, ovah написа:
[...] I'm not actually sure what
> this method is called but it also works for me
> ("-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*")

https://en.wikipedia.org/wiki/X_logical_font_description


Fontconfig also accepts the form [fontname]-[size]

https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user.html#AEN36

Reply all
Reply to author
Forward
0 new messages