Skip to content

Fix character sizing - #178

Merged
vaxerski merged 4 commits into
hyprwm:mainfrom
flashrun24:fix-character-sizing
Oct 24, 2026
Merged

vaxerski merged 4 commits into
hyprwm:mainfrom
flashrun24:fix-character-sizing

Conversation

@flashrun24

Copy link
Copy Markdown
Contributor

Reopening #177 .
This should fix #176 , previously the advance_x(the amount of pixels that each character takes) was hardcoded to 11.0 which I guess works for most monospace fonts, however it seems that Martian Mono Regular has a different advance_x(13.0 which is >11.0). As such, the text would go outside of the box. This change makes it so that the advance_x is obtained dynamically after the font is set instead of hardcoding 11.0. I also changed the text padding so the text is centered as previously we would pad the start by 5 px and the end by 3 px. I have tested this for both JetBrains Mono and the Martian Mono and both of them behave correctly after this fix.

@flashrun24

Copy link
Copy Markdown
Contributor Author

As a note, vertical spacing seems to be fine for JetBrains Mono and Martian Mono so I didn't touch it.

@flashrun24

Copy link
Copy Markdown
Contributor Author
hyprpicker-char-sizing.mp4

Video of it working with Martian Mono above, video of it working with JetBrains Mono below:

hyprpicker-char-sizing.mp4

@vaxerski
vaxerski merged commit 471a89c into hyprwm:main Oct 24, 2026
1 check passed
@flashrun24
flashrun24 deleted the fix-character-sizing branch October 24, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text previewing the colour string overflows the box

2 participants