-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default map font for Map and Overmap #29036
Conversation
I think the main problem is that font don't get rendered correctly due to scaling, because some players will prefer 16px, other 20px, and other 24px. Also, the font is not the problem, these rendering artifacts happens with pretty much any font I tried and only on CDDA, it's really weird. I'd dig on that myself but I don't have much experience with C++. As for default the size / font preference, I don't mind, as I do think that any size of any square font will be better than the current setting. EDIT: BTW, I do see in your second image, due to artifacts/scaling, the "c" looks pretty much like an "o". |
I was read the code that loads the font and use it (stdtiles.cpp) and found out that setting "fontblending" enables font antialiasing (calls to TTF_RenderUTF8_Blended() instead of TTF_RenderUTF8_Solid()). I remember at one point that I didn't like "fontblending" because it actually blurs all the font a bit, but when I restest it again I noticed that it actually fixes artifacts, like the "c" that seems like an "o" at 15px that I mentioned in my previous comment. Since the rendering of the TTF fonts seem to be cached, wouldn't be a good idea activate that by default too? or was that causing any issues for some players? EDIT: also, maybe more improvements can be made by setting a "Font Hint" when loading the font? But I haven't found much documentation about it and I don't have a dev environment to build CDDA to test changes myself. Look at the "c", "m" and "~" on these screenshots, font blending performs better in those cases: |
Definitely should be a thing, at least in tiles version of game. |
Long awaited change. Thanks |
This font supports English only. For example, notes on a map in Russian look like empty boxes. |
I believe Unifont is the current font for exactly that reason - it supports pretty much all glyphs that could be needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a font with most of Unicode symbols, so it would support non-English languages.
Maybe we need to implement an in-game option for font typeface and size change in game? |
If you switch to non-English language and generate new world/overmaps, city names would use names from that language, thus these names won't be rendered properly in this new font. Here: |
I've been doing some search to see if I could find another "libre" font that we could use and supported a large range of Unicode characters and the only one I found was Google Noto. But it has a few problems:
So, I guess the only option left is to go back to "unifont" until some heavy code improvements are implemented (OTF support? fallback to rendering town names with a specific font but use other fonts for other tiles in overmap?), but I'll still recommend to set the fontwidth/fontheight for map and overmap to an square size, even with unifont. EDIT: Also, I noticed unifont has released changes since it was initially added to CDDA, the repo has version 9.0.06 and they are currently distributing 12.0.0.1. So I added a commit to update it. |
Can you update "Overmap New default" image in the OP? |
@AMurkin: Done |
@Firestorm01X2 You have anything to add here? I think the square font you've posted in the forums before looks really good. |
No. There is latest version. Watch out- something may be done not as it should be- I don't have a lot of expirience in creating fonts. But it works. |
But I was recommending that with no font or code change. If you are doing any of that, of course my recommendation wouldn't apply anymore. TBH I don't even know what you changed, if code or font or what, but I definitely like what I see in the second screenshot!! |
Summary
SUMMARY: Interface "Change default font height/width for Map and Overmap to make square tiles"
Purpose of change
I propose changing the Map and Overmap to an square font. This kind of font is arguably better for showing square shaped multi-tile objects (like vehicles and buildings) and feel more natural, also diagonal distance is kept proportional to cardinal distances.
Describe the solution
I had a good experience using the "White Rabbit" font (which is MIT licensed) in my 1920x1080 22" monitor, I set the height, width and size to 20px, which is a bit higher than the current 8px by 16px font, but with this dimensions it seems to avoid rendering artifacts (using 24px gets even better but may be too big for a default)Since CDDA have support for internationalization and needs a default font that supports unicode glyphs for multiple languages (including CJK), it's very hard to find a new font suitable for the overmap, but we still can change the fontheight and fontwidth to generate square tiles for the map/overmap.
Describe alternatives you've considered
I tried looking for other "free" (as in freedom) square fonts with glyphs that look good for a map mode but didn't have much success. This one feels quite good, I specially liked the glyphs for symbols and the only criticism I have for it is that some capital letters may look similar (like A and R or O and D), but that's it.Google Nato is the only other "libre" font I found that support for multiple languages and could be used instead of "unifont", but it is distributed in multiple .ttf files, or in the case of CJK languages, even .otf /.otc files which aren't currently supported by CDDA.
If anyone think there are a better for to use as default, please recommend it here.
Additional context
The default font used for text and other UI elements seems good enough to me, so I didn't change that.
Screenshots
Overmap Current default:
Overmap New default:
"Map" Current default:
"Map" New default: