Difference between revisions of "ImageFontFormat"

m
(Edited negative spacing paragraph to reflect information in the lg.newImageFont article.)
 
Line 5: Line 5:
 
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.
 
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.
  
In versions prior to [[0.10.0]] the width of the separator area after a particular font glyph sets the amount of space that goes after the glyph. It is currently not possible to add negative spacing for a character.
+
In versions prior to [[0.10.0]] the width of the separator area after a particular font glyph sets the amount of space that goes after the glyph. As of [[0.10.0]], it is possible to add negative spacing for all characters by using the 3-parameter version of [[love.graphics.newImageFont]] and giving a negative number as the third parameter.
  
 
== See Also ==
 
== See Also ==

Latest revision as of 07:30, 15 January 2016

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.

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.

In versions prior to 0.10.0 the width of the separator area after a particular font glyph sets the amount of space that goes after the glyph. As of 0.10.0, it is possible to add negative spacing for all characters by using the 3-parameter version of love.graphics.newImageFont and giving a negative number as the third parameter.

See Also

Other Languages