fonts anti-aliasing

Started by Monsieur OUXX, Thu 20/07/2017 15:48:46

Previous topic - Next topic

Monsieur OUXX

Since the AGS scripters dream team is currently in Iceland, I'm sure it will be super easy for them to find a few minutes to interrupt their current board game or outdoor sports activity to help AGSers in distress ;)

I'm currently rewriting the wiki about Fonts, and I'm confused regarding the fonts anti-aliasing.

If you know some answers, please answer each question as separately as possible

  • When you "use TTF fonts", does it mean: "use TTF fonts that were definitely rendered into pixel fonts at import time"? Or does AGS only render them in the Fonts pane but still secretely keeps the original TTF font for just-in-time rendering ?


  • Does AGS import the font with no anti-aliasing and then adds it at rendering time, in the engine?

  • How does anti-aliasing work in relation with outlines? I've tried to use a TTF font in a 640x480 game, enabled anti-aliasing in the game settings, and then enable "automatic outlineStyle" in the font. The result is terrible (the font gets totally screwed up because the outline also gets anti-aliased it seems, so it inserts transparent pixels randomly in the text)

  • In 2017, what is the added value of Calin Leafshade's SpriteFont Rendere plugin? ( here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44359.5  )
 

Crimson Wizard

#1
I can answer on first two questions:
Quote from: Monsieur OUXX on Thu 20/07/2017 15:48:46
When you "use TTF fonts", does it mean: "use TTF fonts that were definitely rendered into pixel fonts at import time"? Or does AGS only render them in the Fonts pane but still secretely keeps the original TTF font for just-in-time rendering ?

Does AGS import the font with no anti-aliasing and then adds it at rendering time, in the engine?

AGS does not convert TTF fonts into "pixel fonts" on import, it keeps exactly same files, and compiles them into the game. It also uses exactly same method (font library) to display both types of fonts in Editor and game.

Anti-aliasing cannot be "imported" when you have TTF fonts, because TTF font does not have any "pixels" stored in the data, it describes geometry.
Anti-aliasing is a part of drawing process, and so that's drawing library that decides how to draw actual pixels, and does anti-aliasing. It may or may not cache letters with AA in memory, but that's a question of internal optimization.

Therefore, anti-aliasing is not a property of font, nor import, but a parameter of display. You can change it realtime with "SetGameOption(OPT_ANTIALIASFONTS, 1 or 0)" script command.

Monsieur OUXX

Quote from: Crimson Wizard on Thu 20/07/2017 23:00:02
Therefore, anti-aliasing is not a property of font, nor import, but a parameter of display. You can change it realtime with "SetGameOption(OPT_ANTIALIASFONTS, 1 or 0)" script command.

Thank you for answering that one, I wasn't sure if AGS stored in the game resources the same data as this rendered, antialiased cache, and nothing more (created at import time).
Does anyone know about the other ones? How does antialias work in relation with outlines, and what is the added value of Calin Leafshade's plugin?
 

Snarky

Quote from: Monsieur OUXX on Fri 21/07/2017 13:41:13
How does antialias work in relation with outlines

Not very well.

Quote from: Monsieur OUXX on Fri 21/07/2017 13:41:13
what is the added value of Calin Leafshade's plugin?

Calin's plugin has little to do with TTF fonts. As the name indicates, it provides sprite-based (i.e. bitmap) font display. The most important benefit over AGS's built-in bitmap font support is that you can do text in more than one color at a time. Kathy Rain, for example, used this to do a gradient effect in its text display, or you can pre-render an antialiased font with outline to get around the problems with AGS auto-outlining (either for antialiased text or simply to get a thicker outline).

SMF spam blocked by CleanTalk