-
Notifications
You must be signed in to change notification settings - Fork 419
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
Can we have pixel-based sizing for fonts? #268
Comments
A point is 1/72 of an inch. I would love to have pixel-absolute sizes for fonts but I've yet to see a TTF renderer that really offers that. :-/ If we can figure out how to do it, we should do it. For now the easiest way to get pixel-absolute fonts is to use bitmap fonts. |
The DPI is calculated from the display size, and not the size of the window. So running my little game in the same sized window on my internal and external monitor gave different font sizes. I forced ggez to use 72 as DPI and the problem was "solved". Not pretty, but not sure how to fix this properly. |
Notes on how SDL2 does it:
|
Honestly just having a function that builds a |
I'm doing this by basically determining the pt -> pixel sizes experimentally and just saving that info statically for now. Having that function would be killer. |
Should resolve #268 eventually, but currently needs testing and refactoring.
Tested, it works. |
Closing. 😢 See #587 for basically the reason why. |
I'm trying to make a pixelated game, using pixel art and a pixel font. Regarding text, this doesn't seem to be doable? Point sizes are unusable for various reasons:
Why would a gamedev want to deal in Pts? What are Pts? Do they even have a fixed meaning?
My screen lies horribly about its DPI, many screens are the same. Very few screens give a completely accurate number. It can't really be relied on for anything.
If I had access to the measured DPI I might use it to scale the text down to compensate away the DPI-sensitive code further up the toolchain, but there doesn't seem to be a way to get that number.
To hammer my point home, I will supply a picture of the hello world example as it appears on my machine https://imgur.com/a/TUXLr
The text was updated successfully, but these errors were encountered: