Difference between revisions of "ImageFontFormat"

(quick draft of an actual explanation; needs wrok & chekcing!!1)
 
m (Improved link)
Line 3: Line 3:
 
The ''upper left pixel'' of the image file is always taken to be the spacer color. All columns that have this color as their uppermost pixel are interpreted as separators of font glyphs. The areas between these separators are interpreted as the actual font glyphs.
 
The ''upper left pixel'' of the image file is always taken to be the spacer color. All columns that have this color as their uppermost pixel are interpreted as separators of font glyphs. The areas between these separators are interpreted as the actual font glyphs.
  
The width of the separator areas affect the spacing of the font glyphs. It is possible to have more areas in the image than are required for the font in the [[love.graphics.newImageFont |love.graphics.newImagefont()]] call. The extra areas are ignored.
+
The width of the separator areas affect the spacing of the font glyphs. It is possible to have more areas in the image than are required for the font in the [[love.graphics.newImageFont]]() call. The extra areas are ignored.
  
 
TODO: Link to tutorial, upload a PoT sample image that works on every computer.
 
TODO: Link to tutorial, upload a PoT sample image that works on every computer.

Revision as of 18:08, 10 September 2010

The imagefont file is an image file in a format that Löve can load. It can contain transparent pixels, so a PNG file is preferable, and it also needs to contain spacer color that will separate the different font glyphs.

The upper left pixel of the image file is always taken to be the spacer color. All columns that have this color as their uppermost pixel are interpreted as separators of font glyphs. The areas between these separators are interpreted as the actual font glyphs.

The width of the separator areas affect the spacing of the font glyphs. It is possible to have more areas in the image than are required for the font in the love.graphics.newImageFont() call. The extra areas are ignored.

TODO: Link to tutorial, upload a PoT sample image that works on every computer.