Difference between revisions of "love.graphics.newImageFont"

m (Replace newin with PrettySince)
m
Line 45: Line 45:
 
[[Sub-Category::Object Creation| ]]
 
[[Sub-Category::Object Creation| ]]
 
{{#set:Description=Creates a new [[Font]] by loading a specifically formatted image.}}
 
{{#set:Description=Creates a new [[Font]] by loading a specifically formatted image.}}
{{#set:Since=000}}
+
{{#set:Since=020}}
 
{{#set:PrettySince=0.2.0}}
 
{{#set:PrettySince=0.2.0}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.newImageFont}}
 
{{i18n|love.graphics.newImageFont}}

Revision as of 15:50, 27 December 2015

Creates a new Font by loading a specifically formatted image. There can be up to 256 glyphs.

In versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string.


O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!  



Function

Synopsis

font = love.graphics.newImageFont( filename, glyphs )

Arguments

string filename
The filepath to the image file.
string glyphs
A string of the characters in the image in order from left to right.

Returns

Font font
A Font object which can be used to draw text on screen.

Function

Synopsis

font = love.graphics.newImageFont( image, glyphs )

Arguments

Image image
The Image object to create the font from.
string glyphs
A string of the characters in the image in order from left to right.

Returns

Font font
A Font object which can be used to draw text on screen.

Function

Available since LÖVE 0.10.0
This variant is not supported in earlier versions.

Synopsis

font = love.graphics.newImageFont( filename, glyphs, extraspacing )

Arguments

string filename
The filepath to the image file.
string glyphs
A string of the characters in the image in order from left to right.
number extraspacing
Additional spacing (positive or negative) to apply to each glyph in the Font.

Returns

Font font
A Font object which can be used to draw text on screen.

See Also



Other Languages