Jibble

There is a new version of the forums ready for testing. Please post here if you're willing to help test! We could also use the help of coders!

Author Topic: Unicode fonts for the game templates  (Read 243 times)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Unicode fonts for the game templates
« on: 28 Jul 2022, 17:53 »
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?

Re: Unicode fonts for the game templates
« Reply #1 on: 28 Jul 2022, 19:39 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Unicode fonts for the game templates
« Reply #2 on: 28 Jul 2022, 20:23 »
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.

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...
« Last Edit: 28 Jul 2022, 20:25 by Crimson Wizard »

Re: Unicode fonts for the game templates
« Reply #3 on: 28 Jul 2022, 20:40 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Unicode fonts for the game templates
« Reply #4 on: 28 Jul 2022, 23:27 »
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

Re: Unicode fonts for the game templates
« Reply #5 on: 29 Jul 2022, 22:41 »
I was trying to collect useful pixel fonts in this topic here. Do you have any specific size, looks or something in mind?
« Last Edit: 29 Jul 2022, 23:08 by eri0o »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Unicode fonts for the game templates
« Reply #6 on: 29 Jul 2022, 23:44 »
Do 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.