|
|
Line 395: |
Line 395: |
| * '''The AGS engine (when it uses TTF fonts)''' can display 256 characters. Let's say you typed "é" in the script editor. That's character number 233. In-game, the engine will simply render it with the font character number 233 from your TTF font. If your TTF font has a drawing for that character, and if the drawing is correct, it will display an "é" in-game. | | * '''The AGS engine (when it uses TTF fonts)''' can display 256 characters. Let's say you typed "é" in the script editor. That's character number 233. In-game, the engine will simply render it with the font character number 233 from your TTF font. If your TTF font has a drawing for that character, and if the drawing is correct, it will display an "é" in-game. |
|
| |
|
| == AND FINALLY, CHOOSE YOUR DESTINY (how to have 256 characters in your game) == | | == CONCLUSION == |
|
| |
|
| With the release of AGS 3.4 and Rulaman's TtfWfnSci tool, the most reliable (and convenient) solution for bitmap fonts will become more and more the '''mad scientist strategy'''. The best solution for hi-res games using out-of-the-box TTF fonts remains the '''Lucky Guy's strategy'''.
| | Let's recap: the main strategies regarding fonts in an AGS game are: |
| If you don't care about non-English gamers, or if you care about them but are already used to the old, counter-intuitive way of doing things, then use the '''Hacker's strategy'''.
| | * For a hi-resolution game, use a TTF fonts used "as-is" (not converted to bitmap). Make sure it has all Western Europe 256 characters (read section "How can I find fonts?") |
| If you want bitmap fonts but don't like AGS Draconian or can't wait for AGS 3.4, then stick to the '''brute force strategy'''.
| | * For a low-resolution game, use a bitmap/pixels font. Two solutions: |
| | : - Draw it from scratch, or extend it from an existing 128-characters font. In both cases, use Rulaman's WFN-FontEditor for drawing the characters and saving in the proper format (and use Radiant's Font Editor for the first 128 characters if you really need it). |
| | : OR |
| | : - Create it by rendering a TTF font into bitmap (see section "how can I make fonts?") |
| | |
|
| |
|
| | | Regardless of the resolution of your game, if you want to use anti-aliasing with your font, then use Calin Leafshade's SpriteFont renderer plugin (described earlier). |
| === A. The hacker's strategy ===
| |
| | |
| People used to do this :
| |
| # Stick to 128-chars SCI or WFN font
| |
| # Pick a handful of rarely-used characters within the 128 characters. For example, ASCII characters [http://www.morbleu.com/wp-content/uploads/2009/08/ascii.gif 92 to 96, and 123 to 127]. (Note: Don't pick 91 ( "'''['''" ) as it's a special character for AGS).
| |
| # Decide that these characters will be used for something completely different. For example: "_" won't be "_" anymore, but instead it will be "é".
| |
| # Edit your font and replace "_" with a nice drawing of a "é".
| |
| # Export the translation files and make your translator(s) translate it --> The resulting file is likely to contain some "é". (reminder: Make them use a good text editor! Not notepad!)
| |
| # Do a "replace all" in the file, and replace every "é" with "_".
| |
| # Import the translation file back into AGS.
| |
| # Play the game. With your custom, every "_" appears as a "é", and everything looks fine.
| |
| | |
| ::'''Pros:'''
| |
| ::* Quick hack
| |
| ::'''Cons:'''
| |
| ::* You might run out of special characters.
| |
| ::* If you translate into several languages, you'll need several fonts for sure...
| |
| ::* You might make human mistakes with all those "replace all"
| |
| | |
| === B. The lucky guy's strategy ===
| |
| | |
| This solution makes you use a regular version of AGS, along with TTF fonts used "as-is" (not converted to bitmap).
| |
| | |
| :1. Find one (or several similar-looking) TTF font(s) that has(have) all the special characters you need. As said before, many of them even mimic the pixel-art style. (see section "how can I find fonts?"
| |
| | |
| :{| class="wikitable"
| |
| |-
| |
| | '''Pro-tip:''' Search free fonts in websites '''of the targeted country'''. For example, if you need French characters, then search [http://www.dafont.com this one], type "pixel" in the search box, and download only the fonts that have the "accents" flag on the left-hand side.
| |
| |}
| |
| | |
| :2. Import the font into your game. Special characters should be rendered correctly.
| |
| | |
| :{| class="wikitable"
| |
| |-
| |
| | '''Pro-tip:''' When you import the font into AGS, it will ask you to choose the font's height. That's because TTF fonts are ''vectorial'', which means they don't have an actual "size" in pixels; ''you'' must choose the size that AGS will use to render them on-screen. However, if your TTF font mimics pixel-art, you need to find an import height that will make them look fine: that is, the height in actual pixels, once rendered, will be the same as the font was in "fake" vectorial pixels. If you don't know what height to pick, try every value between 5 and 20, that does the trick for most fonts (especially 10,11 or 12).
| |
| | |
| But this has a '''major inconvenience:''' if the fake pixels of the TTF font are slightly off, then some rendered pixels (once the font is converted to real pixels) might get anti-aliased... Which means dirty... A complete disaster. If that happens, you just can't use that font, unless you use one of the other strategies.
| |
| |}
| |
| | |
| | |
| ::'''Pros:'''
| |
| ::* Simplest and most elegant solution.
| |
| ::'''Cons:'''
| |
| ::*Lots of hazard...
| |
| ::** If you don't find the TTF font with the special characters you need, you're done for.
| |
| ::** If you need a font with a '''special '''outline (like [http://img2.imageshack.us/img2/8323/foacreditsfont.gif this one]), you're done for! (but if you can just stick to AGS' '''automated''' outline, you're good)
| |
| ::** As explained above, some fake pixel-art fonts will look dirty once converted from TTF to real pixels.
| |
| | |
| === C. The mad scientist's strategy ===
| |
| | |
| # Use at least AGS 3.4.x -- or if you use an older AGS, then use [http://www.adventuregamestudio.co.uk/forums/index.php?topic=44502.0 "AGS Draconian"]
| |
| # Use Rulaman's WFN-FontEditor in combination with TtfWfnSci (see corresponding sections in this document)
| |
| # If you're European, we recommend you directly start off with an existing '''256-char''' SCI or WFN font (see corresponding section in this document) -- this way, you already know what slots match what characters in that code page (Reminder: 256-char SCI or WFN are "fake" formats that can be used only in that context. Regular SCI or WFN allow only 128 characters).
| |
| # Save it as your own font, import it into AGS Draconian.
| |
| # Run the game. All characters should be displayed correctly.
| |
| | |
| | |
| ::'''Pros:'''
| |
| ::* Very convenient solution.
| |
| ::* Outlined fonts made very easy.
| |
| ::'''Cons:'''
| |
| ::* You're using an experimental AGS with a non-standard font format... BUT '''the Draconian edition is very reliable''', and an important part of its tweaks are later on merged into the regular AGS. There's a good chance that this becomes '''AGS standard''' at some point. '''I Think it's now the case! Try AGS 3.4!'''
| |
| | |
| === D. The brute force strategy ===
| |
| | |
| This solution makes you use a regular AGS, but with a plugin.
| |
| | |
| # Create a bitmap font from any TTF font using strictly Calin Leafshade's SpriteFont renderer (see corresponding section of this document). You acknowledge that this font will have any character mapping of your choice.
| |
| # Follow the steps to integrate this custom character mapping into your game with Calin's plugin. (see corresponding section of this document)
| |
| | |
| ::'''Pros:'''
| |
| ::* Prettier rendering of the fonts
| |
| ::* You gain in compatibility with vanilla AGS, because you use only standard AGS tech
| |
| ::'''Cons:'''
| |
| ::* You lose in compatibility with less-used Operating Systems if you find yourself unable to compile your plugin for Unix/MacOS/whatnot (you will find that most plugins are open-sourced, and therefore can also be compiled for those systems, but many AGS game-makers only know how to use the already-compiled DLL, so they're screwed. Are you one of them? ;) ).
| |
|
| |
|
|
| |
|
| [[Category:Intermediate Tutorials]] | | [[Category:Intermediate Tutorials]] |