• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

SOLVED How to get pixel fonts to render perfectly

dmoore764

Member
I'm having a lot of trouble getting pixel fonts to look nice, and I feel like I've been through all the options in the Font Editor, including of course turning off anti-aliasing, and all the options in "Advanced Settings," but I still get text that doesn't match the preview from dafont.com. Is there a better way to do this using the internal tools in GameMaker? If not, what is the easiest way outside of GMS?

Here's an example, first is actual font, second is in-game, using "no scale, disable hinting, anti-aliasing off": (font is VCR OSD Mono)
ActualVsInGame.png
 

TsukaYuriko

☄️
Forum Staff
Moderator
The text on the left (preview) is anti-aliased, but you state that you turned anti-aliasing off while trying to re-create the look... so which of the two are you looking for? I'd imagine "pixel font" to mean solid black or solid white, nothing in between, no alpha channel, in which case you're getting exactly that on the right.
 

Pixel-Team

Member
The text on the left (preview) is anti-aliased, but you state that you turned anti-aliasing off while trying to re-create the look... so which of the two are you looking for? I'd imagine "pixel font" to mean solid black or solid white, nothing in between, no alpha channel, in which case you're getting exactly that on the right.
I think his problem is he wants the one on the right, but he's having half pixels drawn.
 

Pixel-Team

Member
I've dealt with this problem myself, and the thing to remember with tru type fonts is that they are essentially vector shapes. So when you get one that is designed to be a pixel font, you have to use the correct point size that the font is intended to be viewed at, or you will get little squares that are not evenly sized when the glyph sheet is generated. Sometimes this is difficult to determine without a little trial and error. I would experiment with different point sizes and see if that gets you there.
 

Yal

🐧 *penguin noises*
GMC Elder
Usually pixel fonts are optimized to render at integer multiples of either 8 pixels point size (retro authentic), or 12 (standard text size in documents). Is your font set to use either of these sizes? (Larger multiples like 16, 24 etc should work fine too in theory)
 

dmoore764

Member
Sorry my screenshot isn’t self explanatory... on the left is a screen grab of the blown up version from dafont, where you can clearly see the clean stair step of the letter X (sorry it’s anti aliasing, that’s confusing). On the right side, no matter what font size I render, or what option, I can’t get the correct rendering to match what the font should look like.
 

dmoore764

Member
Ok, I basically found out that pixel sizes and point sizes don't always line up, so there may be fonts that are impossible to get to render correctly with gamemaker. I instead made a tool using stb_truetype in C++ that renders a ton of sizes and looks for anti-aliasing, and if it doesn't find any, it renders it out to a series of sprites that can be used with font_add_sprite_ext. Some extra work, but it only took a few hours.
 
Top