Unicode fonts for the game templates

Started by Crimson Wizard, Thu 28/07/2022 17:53:46

Previous topic - Next topic

Crimson Wizard

Not sure where to post this, but following a user's problem report recently I remembered that the game templates feature ASCII bitmap fonts. In 3.6.0 the default text mode is Unicode, but if you try to use unicode texts in your game right of the start, the game won't be able to display them. Besides annoyance, for a new user this may cause a false impression that AGS does not really work with the unicode.

Replacing fonts may be not a trivial task, as they have to at least match the template's art style. So I wonder, can anyone contribute to this, perhaps if you know a good suitable TTF which at least have extended latin letters (with accents etc), or can even draw one (who knows)? Or is there a way to convert a bitmap font to TTF reliably?

Laura Hunt

I'm not really sure how this is achieved, but there are a lot of fonts that seem to be compatible both with Windows-1252 encoding and with Unicode. Take for example this one: https://www.dafont.com/press-start.font

If your game is in ASCII/ANSI (the way it is in the beta by default) and you import this font to slot 1, for example, "extended" latin characters will display properly (Spanish accents like á or Á, or German umlauts like ö or Ü).

Now switch your game to Unicode, and these characters will be garbled. But if you import the same font to a different slot (e.g., font 2) and reassign SpeechFont and NormalFont to this one, the characters will once again display properly.

(Note: import size is 8, and for some reason, some fonts like this one need to have the TTF font adjustment property set to "Resize ascender to nominal font height", otherwise they will be cut off at the top.)

This seems to be quite random, since some of the fonts in that page are only ANSI compatible, some are only Unicode, and others can even tolerate the conversion from ASCII/ANSI to Unicode without issues (setting the engine back to ASCII again will garble everything, though). But it might be worth checking the "bitmap" section of the page for fonts that are unicode compatible, a reasonable size for low-res pixel games (8 to 10px) and GPL / public domain or have a "100% free" license.

Crimson Wizard

#2
Quote from: Laura Hunt on Thu 28/07/2022 19:39:32
If your game is in ASCII/ANSI (the way it is in the beta by default)

Please note that 3.6.0 is Unicode by default.

Quote from: Laura Hunt on Thu 28/07/2022 19:39:32
Now switch your game to Unicode, and these characters will be garbled. But if you import the same font to a different slot (e.g., font 2) and reassign SpeechFont and NormalFont to this one, the characters will once again display properly.

This sounds like a error either in editor or engine...

Laura Hunt

Quote from: Crimson Wizard on Thu 28/07/2022 20:23:38
Quote from: Laura Hunt on Thu 28/07/2022 19:39:32
If your game is in ASCII/ANSI (the way it is in the beta by default)

Please note that 3.6.0 is Unicode by default.

I thought that the beta versions were still ANSI by default and that this would only be changed with the official release, once appropriate fonts had been found and implemented. Was this not the intention?

Crimson Wizard

Quote from: Laura Hunt on Thu 28/07/2022 20:40:07
I thought that the beta versions were still ANSI by default and that this would only be changed with the official release, once appropriate fonts had been found and implemented. Was this not the intention?

The intention was to have default at Unicode, but apparently I forgot about the default fonts in templates.

eri0o

#5
I was trying to collect useful pixel fonts in this topic here. Do you have any specific size, looks or something in mind?

Crimson Wizard

Quote from: eri0o on Fri 29/07/2022 22:41:25Do you have any specific size, looks or something in mind?

The one that would look good in the default template. I can tell whether something looks fine or not, but I doubt that may guess size or style beforehand.
Maybe we should ask around people who make games, see if they can find a suitable font for the default template's style.

SMF spam blocked by CleanTalk