How to get fonts to render properly on high DPI (retina) screens? (SOLVED)

#1

I’m evaluating Defold for a game that will use a lot of text. I can display a TrueType font just fine, but it is not as well-rendered as the same font on a Retina Macintosh. (I have High Dpi set in game.project.)

A workaround seems to be to create my font asset at twice the desired size, and then scale my GUI text to 0.5. But this feels klunky.

Is there a way to get a font to automatically display at Retina resolution?

1 Like

#2

Hi David,

there are two different font variants available in Defold, “bitmap” and “distance field” fonts. Distance field fonts is what you are looking for, since they can be generated/built at a fairly small size (saving memory/disk space) but rendered with high quality at runtime. :+1:

Take a look at this manual: https://defold.com/manuals/font/?q=distance%20font#distance-field-fonts

2 Likes

#3

Thanks for the quick answer!

Distance Field looks terrible.Defold%20font

Bitmap looks adequate, but not as high resolution as actual TrueType (top of the image).TrueType%20vs%20Defold

0 Likes

#4

You need to make sure you are using the corresponding material for the font. There are specific materials named *df* that should be used, if I’m not mistaken.

5 Likes

#5

Aha, it looked like it was set that way… I changed it and changed back and now the output looks great. Thanks!

1 Like