Difference between revisions of "Font:setFallbacks"

(Created page)
 
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{newin|[[0.10.0]]|100|type=function}}
 
{{newin|[[0.10.0]]|100|type=function}}
Sets other Fonts to use if this Font doesn't have a specific character. When that happens, the glyph from the first fallback Font to have the character will be used, instead of a blank box or other 'no character' symbol being used.
+
Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a "font stack" in Cascading Style Sheets (CSS).
 +
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 8: Line 9:
 
=== Arguments ===
 
=== Arguments ===
 
{{param|Font|fallbackfont1|The first fallback Font to use.}}
 
{{param|Font|fallbackfont1|The first fallback Font to use.}}
{{param|Font|...|Additionall fallback Fonts.}}
+
{{param|Font|...|Additional fallback Fonts.}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
Line 14: Line 15:
 
If this is called it should be before [[love.graphics.print]], [[Font:getWrap]], and other Font methods which use glyph positioning information are called.
 
If this is called it should be before [[love.graphics.print]], [[Font:getWrap]], and other Font methods which use glyph positioning information are called.
  
Every fallback Font must have been created from the same type of file as this Font. For example, a Font created from a .ttf file can only use fallback Fonts that were also created from .ttf files.
+
Every fallback Font must be created from the same file type as the primary Font. For example, a Font created from a .ttf file can only use fallback Fonts that were created from .ttf files.
 +
 
 
== See Also ==
 
== See Also ==
 
* [[parent::Font]]
 
* [[parent::Font]]

Latest revision as of 01:07, 18 September 2016

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

Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a "font stack" in Cascading Style Sheets (CSS).

Function

Synopsis

Font:setFallbacks( fallbackfont1, ... )

Arguments

Font fallbackfont1
The first fallback Font to use.
Font ...
Additional fallback Fonts.

Returns

Nothing.

Notes

If this is called it should be before love.graphics.print, Font:getWrap, and other Font methods which use glyph positioning information are called.

Every fallback Font must be created from the same file type as the primary Font. For example, a Font created from a .ttf file can only use fallback Fonts that were created from .ttf files.

See Also

Other Languages