Topic: Font size @ 4K
pullmoll Topic Opener |
Posted at: 2017-12-19, 17:47
Hi there, I'm packaging widelands for Void Linux and just updated to ver. 19, only to find that the binary installs as /usr/widelands instead of /usr/bin/widelands. Ok, this is my own problem However, another problem I can't solve and which may be related to how I built widelands is that the in game font size on my 4K display (3840x2560) is so very damn small that it's really hard to read. A screenshot of a menu in 2560x1440 window mode is here: http://de.tinypic.com/view.php?pic=2em0ejc&s=9 Also setting the full screen resolution to e.g. 1280x720, which I used with ver. 18, does not seem to work. The options I used to build widelands with cmake are:
It seems I can't set something like a font scaling factor from the command line or by an environment variable? I then looked through the source and saw only some hard coded values for UI_FONT_SIZE_BIG=22, SMALL=14, ULTRASMALL=10. The only functions I found that do some sort of scaling with these fixed values are So what could be the reason for (a) the resolution setting being ignored and (b) the font size (as a consequence?) not being scaled? Thanks for the game! I appreciate all your work. Jürgen Top Quote |
kaputtnik |
Posted at: 2017-12-19, 18:29
Hi pullmoll, welcome to the forums I think for build19 you can't do anything regarding the font size. Some users with retina displays have the same problem, afaik. Maybe we have a new font renderer in build20... but i am not sure if that will fix your issue. GunChleoc can answer that. Thanks for packaging Fight simulator for Widelands: |
pullmoll Topic Opener |
Posted at: 2017-12-19, 18:43
It was about time for me...
To me it seems that the system's DPI setting is ignored and the game assumes a fixed e.g. 72 or 96 dpi (or 75 or 100). I configured a value of 150 dpi in my xfce4 DE and on the desktop the fonts are ok. If widelands would recognize such a setting wherever this may come from (no clue actually.. fontconfig? SDL2?) that would certainly help. I could try to find out and add some code to the scaling function to adjust accordingly. If time permits I'll take a look and devise a patch (for my own use) and contribute it.
No reason. It's all about fun or is it? Top Quote |
GunChleoc |
Posted at: 2017-12-19, 19:54
At the moment, the font sizes are all hard coded. I would love to have them all in a Lua file for easier customization, but that is still along way off. Plus a scaling factor in the UI. Getting everything converted to the new font renderer is only the first step - it's one of the reasons that I didn't work on this yet, because I don't want to do the work twice. You can cheat it though by editing the font set in data/i18n/fonts.lua - just edit the size_offset for the default fontset. UI elements won't rescale for it, but you should be fine with size_offset = 4, because that's what Arabic uses. Fullscreen switching does work, but you will have to switch to a different menu page, because they don't relayout themselves yet. Some screens are fixed in the current development trunk, but this is still a work in progress. Busy indexing nil values Top Quote |
pullmoll Topic Opener |
Posted at: 2017-12-22, 11:29
FWIW switching the resolution definitely does not work here. Console output of widelands
This is why I think that the font scaling in Top Quote |
mallrat |
Posted at: 2020-01-22, 18:27
I've worked that around with a script
and then run it as Top Quote |