mangohud: invalid `font_file` declaration
About
This tracking issue manages the font_file hotfix, resolving:
- https://github.com/danth/stylix/issues/298
Steps
- [x] https://github.com/danth/stylix/pull/307
- [ ]
mangohud: declare 'font_file'
cc: @NovaViper
MangoHud appears really small on my monitor
-- https://github.com/danth/stylix/pull/307#issuecomment-2024349791
Is this not caused by the
https://github.com/danth/stylix/blob/b5f4ca49df372c3d26ce04b1554fb02a0107cc8d/modules/mangohud/hm.nix#L12-L13
options rather than the removed font_file option 1?
In that case, considering MangoHud's special gaming use case, we could simply add a scaling factor option to the stylix.targets.mangohud option attribute set, or add a more reusable target option to the stylix.fonts.sizes option attribute set. I would prefer adding a stylix.fonts.sizes option.
@trueNAHO Hey sorry for the delay! The small text seems to be caused by the font_size and font_size_text options, as even though the font_file option is gone, the it's still extremely small. 🤔 In fact i found that the default MangoHud settings has both of those options set to 24 rather than 10 (which is what the font.sizes.applications value is).
Edit: Can definitely confirm it is those two settings! I forced them both to be 24 and the GUI is large again!
When font_size and font_size_text are set to 10 (what stylix is using)
When font_size and font_size_text are set to 24
What unit are font_size and font_size_text measured in?
The Stylix options are in points (1 point = 1⅓ pixels).
What unit are
font_sizeandfont_size_textmeasured in?The Stylix options are in points (1 point = 1⅓ pixels).
It uses ImGUI under the hood so it should be pixels. This line sets the font scaling accordingly with a factor of 1⅓
I took some screenshots and measured the glyph sizes, and it looks like both the size and scaling need to have the 1⅓ factor applied for the glyph size in pixels to be correct. Not sure why the pt->px scaling needs to be applied twice
It should also be noted that the sizing measurements also included the drop shadow to reach the correct glyph size, which is 1px thick at 10pt and 2px thick at 16pt. I'd almost want to bump the scaling up a touch so that the font size corresponds to the non decorative component of the text.