Fonts: Difference between revisions

From Adventure Game Studio | Wiki
Jump to navigation Jump to search
(Created page with "This page is meant to provide '''in-depth explanations''' about how AGS manages fonts, and how to create fonts for AGS. If you only want to read the short version, read [[Tut...")
 
No edit summary
Line 3: Line 3:
If you only want to read the short version, read [[Tutorial_Part_9_-_Cursors_and_fonts#Fonts|this]].
If you only want to read the short version, read [[Tutorial_Part_9_-_Cursors_and_fonts#Fonts|this]].


== The most important part: define your needs ==
== The MOST IMPORTANT part: define your needs ==


Mostly, you need to answer these '''two questions''' :
Mostly, you need to answer these '''two questions''' :
Line 33: Line 33:


* If the answer is '''"b"''', then you need a font in pixel-art. Of course, there are the fonts shipped with AGS or with any of the additional templates. But if you're not satisfied with those, then you now need to lurk on the AGS forums, looking for one of those 3 items:
* If the answer is '''"b"''', then you need a font in pixel-art. Of course, there are the fonts shipped with AGS or with any of the additional templates. But if you're not satisfied with those, then you now need to lurk on the AGS forums, looking for one of those 3 items:
::- Either an archaic '''SCI''' font (see the "supported formats" section of this document) that would still be around in 201x, and would fit perfectly into your game (you like old things, don't you?) ,
::- Either an archaic '''SCI''' font (see the "more about the formats" section of this document) that would still be around in year 201x, and would fit perfectly into your game (you like old things, don't you?) ,
::- or an existing '''WFN''' font (AGS' internal font format) also floating around somewhere on the forums,
::- or an existing '''WFN''' font (AGS' internal font format) also floating around somewhere on the forums,
::- or an actual '''TTF''' font, designed to look like pixel-art (for example [http://www.dafont.com/fr/pixel-perfect.font this one]).
::- or an actual '''TTF''' font, designed to look like pixel-art (for example [http://www.dafont.com/fr/pixel-perfect.font this one]).
Line 39: Line 39:


Read further to know where to find fonts of each type.
Read further to know where to find fonts of each type.
== More about the formats ==
Just an overview of the terms we're going to use.
=== SCI ===
Historically, this format is inherited from Sierra video games, but it doesn't matter here. What does matter is that the SCI format is a very, very old format. It's kept only for legacy reasons, mostly because it used to be a convenient format to manipulate pixel-based fonts (as opposed to vector-based fonts, such as TTF). 
The main issue is that it's tricky to extend it to 256 characters (read further to know why).
:'''Q:''' '''Does it support 256 characters?'''
:'''A:''' '''No, with a twist.''' There is "'''fake'''" SCI file format that was introduced around 2013 with more recent versions of AGS, and with more recent font-editing tools. This '''fake''' SCI format supports 256 characters. See the "how can I make fonts" section.
=== WFN ===
Historically, WFN used to be an actual font file format from an MS-DOS  third-party tool in the mid-90's. But it's not relevant at all anymore. You may instead consider it the official AGS font format.
More specifically, you could see WFN fonts as SCI fonts turned "AGS-ready". Most of them are probably SCI fonts that were imported into AGS at least once.
:'''Q:''' '''Does it support 256 characters?'''
:'''A:''' '''No, with a twist.''' There is "'''fake'''" WFN file format that was introduced around 2013 with experimental versions of AGS, and with more recent font-editing tools. This '''fake''' WFN format supports 256 characters. As for now, it is only supported by '''experimental''' versions of AGS. See the "how can I make fonts" section.
=== TTF ===
TTF is the official Microsoft Windows font file format. It is vectorial, which means it's better at handling normal-sized curved fonts than tiny, pixelly fonts like the ones you usually see in old-school point-n-click games.
:'''Q:''' '''Does it support 256 characters?'''
:'''A:''' '''It depends'''. TTF fonts rely on the Unicode standard (see the "understanding character encoding" section), which means they can virtually represent any character in the entire universe. BUT it depends if the graphic designer who created the font went into the trouble of drawing the characters that you're interested in. Chances are, if you download an English TTF font, open (for example) MS Word, and type any character outside of the 127 standard characters, your text editor will rollback to Times New Roman for those characters. Because that font has them. And your cheap font doesn't.
At least try to find a TTF font that has the 256 characters from the Latin-1 characters set (see "understanding character encoding").
=== Bitmap ===
By "bitmap", we mean any sprites table that you will later use to create a font. It's not a font format in itself and needs work. There will be more about that later.




Line 50: Line 87:


A good place to start is on the [http://www.adventuregamestudio.co.uk/site/ags/sci_fonts/ AGS website "resources" page].  
A good place to start is on the [http://www.adventuregamestudio.co.uk/site/ags/sci_fonts/ AGS website "resources" page].  
Be aware that the SCI format is a very, very old format. It's kept only for legacy reasons, mostly because it used to be a convenient format to manipulate pixel-based fonts (as opposed to vector-based fonts, such as TTF).  The main issue is that it's tricky to extend it to 256 characters (read further to know why).
 


=== WFN fonts ===
=== WFN fonts ===
Line 56: Line 93:
If you search the AGS forums properly, you will find resources of WFN fonts collections.
If you search the AGS forums properly, you will find resources of WFN fonts collections.


You could see WFN fonts as SCI fonts turned "AGS-ready". Most of them are probably SCI fonts that were imported into AGS at least once.  
'''Attention:''' there is a catch to import WFN fonts into AGS. See the "How to import fonts into AGS?" section of this document.
 
=== TTF fonts ===
 
There are plenty of sites providing free fonts. The only catch is that you should make sure that the fonts are free to use (Respect the work of other people! '''Check the fonts' licence!''')
 
 
An example of fonts website: [http://www.dafont.com/ dafont.com]
 
 
== How to import fonts into AGS? ==
 
=== SCI fonts ===
 
AGS expects to find SCI files with the following naming convention : FONT.0, FONT.1, etc.
Therefore, if you want to import fonts made with Radiant's Font Editor (see corresponding section), you need to rename the file you created:
# inside the font editor, save as SCI (the file will be named something like "0.sci", or "1.sci", etc.)
# rename the file to "font.0", or "font.1", etc.
# import from within AGS
 
=== WFN fonts ===


'''Note:''' The only (very) weird thing is that (as of 2013, AGS 3.2.x) '''there is a bug preventing AGS from importing its own format'''! The only way to import a WFN font is :  
WFN is AGS' internal font format. The only (very) weird thing is that (as of 2013, AGS 3.2.x) '''there is a bug preventing AGS from importing its own format'''! The only way to import a WFN font is :  
:- in AGS, create a new font. Note down its number (e.g. "I just created font number 4"),
:- in AGS, create a new font. Note down its number (e.g. "I just created font number 4"),
:- close AGS,
:- close AGS,
Line 65: Line 122:




=== TTF fonts ===
== How can I ''make'' fonts? ==
 
 
=== How to create a 128-characters font from scratch? ===
 
That's the simplest scenario :
# Download '''[http://www.adventuregamestudio.co.uk/forums/index.php?topic=23521.0 Radiant's Font Editor]'''
# Potentially start from one of the WFN fonts provided, then save.
# Import the font into AGS, following the tips given in the "How to import fonts into AGS?" section of this document.
 
 
::'''Pros:'''
::* Very simple
::* Can save as SCI or WFN
::* Can save as BMP sprite table
::'''Cons:'''
::* Limited to 128 characters
::* I'm still using the archaic SCI format!
::* That tool is not maintained (not that it's been an issue so far)
 
 
=== A more versatile AGS-dedicated tool : Rulaman's WFN-FontEditor ===
 
That tool comes in two flavours: either as standalone, or as an AGS-Editor plugin. Either way, it works the same way.
 
Get the tool [http://www.adventuregamestudio.co.uk/forums/index.php?topic=48527.0 '''here'''].
 
The advantage over Radiant's editor is that it allows 256-characters fonts. That's not immediately obvious, so the easiest way to start is to open [http://www.adventuregamestudio.co.uk/forums/index.php?topic=48798.msg636465473#msg636465473 an existing 256-characters font] and work with it.
 


There are plenty of sites providing free fonts. The only catch is that you should make sure that the fonts are free to use (Respect the work of other people! '''Check the fonts' licence!''')
::'''Pros:'''
::* Convenient features such as '''outline'''
::* If used as a plugin, integrated directly in your AGS editor
::* Converts from WFN to SCI and back
::* '''Handles 256 characters'''


::'''Cons:'''
::* Limited to 128 characters
::* I'm still using the archaic SCI format!
::* That tool is not maintained (not that it's been an issue so far)


An example of fonts website: [http://www.dafont.com/ dafont.com]


== Understanding characters encoding ==


==How can I ''make'' fonts? ==
Before you go further, you '''need''' to read this : [http://www.joelonsoftware.com/articles/Unicode.html "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)"]
This way you'll know what '''ASCII, ANSI, "Latin" ISO-8859-1, Unicode''' and '''UTF-8''' mean.

Revision as of 17:40, 14 November 2013

This page is meant to provide in-depth explanations about how AGS manages fonts, and how to create fonts for AGS.

If you only want to read the short version, read this.

The MOST IMPORTANT part: define your needs

Mostly, you need to answer these two questions :


1. Do I want my game to be:

a. In English only?
b. In some common European language that uses most Latin letters? (German, French, Spanish, Polish...)
c. In an alphabet with much more letters? (Russian, Chinese...)


  • If the answer is "a", then you're a happy-go-lucky selfish person. :) no need to worry any further. Just import into AGS any font you like, in any format you like, it will always work.
  • If the answer is "b", then you need to consider looking for/creating fonts that will allow special characters of most European languages, such as : Spanish (ñ, etc.), German (ö, ä, ß, etc.), French (àâêéèëûîïç). BUT the good news is, they still fit in a character table of just 256 characters. This document will explain how to do.
  • If the answer is "c", then AGS wasn't really designed for your needs. There are workarounds, but they are outside of the scope of this document.


Read further to know how to create fonts.


2. Do I want my game to be:

a. high-resolution?
b. low-resolution?


  • If the answer is "a", then just import into AGS any TTF font you'll find on the Interwebs. It will be rendered smoothly, and if you're not happy with the quality of the rendering, you can use Calin Leafshade's plugin (2011) to enhance it even more.
  • If the answer is "b", then you need a font in pixel-art. Of course, there are the fonts shipped with AGS or with any of the additional templates. But if you're not satisfied with those, then you now need to lurk on the AGS forums, looking for one of those 3 items:
- Either an archaic SCI font (see the "more about the formats" section of this document) that would still be around in year 201x, and would fit perfectly into your game (you like old things, don't you?) ,
- or an existing WFN font (AGS' internal font format) also floating around somewhere on the forums,
- or an actual TTF font, designed to look like pixel-art (for example this one).


Read further to know where to find fonts of each type.


More about the formats

Just an overview of the terms we're going to use.


SCI

Historically, this format is inherited from Sierra video games, but it doesn't matter here. What does matter is that the SCI format is a very, very old format. It's kept only for legacy reasons, mostly because it used to be a convenient format to manipulate pixel-based fonts (as opposed to vector-based fonts, such as TTF).

The main issue is that it's tricky to extend it to 256 characters (read further to know why).

Q: Does it support 256 characters?
A: No, with a twist. There is "fake" SCI file format that was introduced around 2013 with more recent versions of AGS, and with more recent font-editing tools. This fake SCI format supports 256 characters. See the "how can I make fonts" section.

WFN

Historically, WFN used to be an actual font file format from an MS-DOS third-party tool in the mid-90's. But it's not relevant at all anymore. You may instead consider it the official AGS font format.

More specifically, you could see WFN fonts as SCI fonts turned "AGS-ready". Most of them are probably SCI fonts that were imported into AGS at least once.

Q: Does it support 256 characters?
A: No, with a twist. There is "fake" WFN file format that was introduced around 2013 with experimental versions of AGS, and with more recent font-editing tools. This fake WFN format supports 256 characters. As for now, it is only supported by experimental versions of AGS. See the "how can I make fonts" section.

TTF

TTF is the official Microsoft Windows font file format. It is vectorial, which means it's better at handling normal-sized curved fonts than tiny, pixelly fonts like the ones you usually see in old-school point-n-click games.

Q: Does it support 256 characters?
A: It depends. TTF fonts rely on the Unicode standard (see the "understanding character encoding" section), which means they can virtually represent any character in the entire universe. BUT it depends if the graphic designer who created the font went into the trouble of drawing the characters that you're interested in. Chances are, if you download an English TTF font, open (for example) MS Word, and type any character outside of the 127 standard characters, your text editor will rollback to Times New Roman for those characters. Because that font has them. And your cheap font doesn't.

At least try to find a TTF font that has the 256 characters from the Latin-1 characters set (see "understanding character encoding").

Bitmap

By "bitmap", we mean any sprites table that you will later use to create a font. It's not a font format in itself and needs work. There will be more about that later.


Where can I find fonts?

We suppose that you want to use fonts that already exist.


SCI fonts

A good place to start is on the AGS website "resources" page.


WFN fonts

If you search the AGS forums properly, you will find resources of WFN fonts collections.

Attention: there is a catch to import WFN fonts into AGS. See the "How to import fonts into AGS?" section of this document.

TTF fonts

There are plenty of sites providing free fonts. The only catch is that you should make sure that the fonts are free to use (Respect the work of other people! Check the fonts' licence!)


An example of fonts website: dafont.com


How to import fonts into AGS?

SCI fonts

AGS expects to find SCI files with the following naming convention : FONT.0, FONT.1, etc. Therefore, if you want to import fonts made with Radiant's Font Editor (see corresponding section), you need to rename the file you created:

  1. inside the font editor, save as SCI (the file will be named something like "0.sci", or "1.sci", etc.)
  2. rename the file to "font.0", or "font.1", etc.
  3. import from within AGS

WFN fonts

WFN is AGS' internal font format. The only (very) weird thing is that (as of 2013, AGS 3.2.x) there is a bug preventing AGS from importing its own format! The only way to import a WFN font is :

- in AGS, create a new font. Note down its number (e.g. "I just created font number 4"),
- close AGS,
- replace file agsfnt4.wfn with your font (and rename your font "agsfnt4.wfn")
- re-open AGS. Font number 4 should now be your font.


How can I make fonts?

How to create a 128-characters font from scratch?

That's the simplest scenario :

  1. Download Radiant's Font Editor
  2. Potentially start from one of the WFN fonts provided, then save.
  3. Import the font into AGS, following the tips given in the "How to import fonts into AGS?" section of this document.


Pros:
  • Very simple
  • Can save as SCI or WFN
  • Can save as BMP sprite table
Cons:
  • Limited to 128 characters
  • I'm still using the archaic SCI format!
  • That tool is not maintained (not that it's been an issue so far)


A more versatile AGS-dedicated tool : Rulaman's WFN-FontEditor

That tool comes in two flavours: either as standalone, or as an AGS-Editor plugin. Either way, it works the same way.

Get the tool here.

The advantage over Radiant's editor is that it allows 256-characters fonts. That's not immediately obvious, so the easiest way to start is to open an existing 256-characters font and work with it.


Pros:
  • Convenient features such as outline
  • If used as a plugin, integrated directly in your AGS editor
  • Converts from WFN to SCI and back
  • Handles 256 characters
Cons:
  • Limited to 128 characters
  • I'm still using the archaic SCI format!
  • That tool is not maintained (not that it's been an issue so far)


Understanding characters encoding

Before you go further, you need to read this : "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)" This way you'll know what ASCII, ANSI, "Latin" ISO-8859-1, Unicode and UTF-8 mean.