Difference between revisions of "Font:hasGlyphs"

m (moved Font:hasGlyph to Font:hasGlyphs: Renamed)
(Renamed and upgraded)
 
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
Gets whether the font can render a particular character.
+
Gets whether the Font can render a character or string.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
hasglyph = Font:hasGlyph( character )
+
hasglyphs = Font:hasGlyphs( text )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|string|character|A unicode character.}}
+
{{param|string|text|A UTF-8 encoded unicode string.}}
 
=== Returns ===
 
=== Returns ===
{{param|boolean|hasglyph|Whether the font can render the glyph represented by the character.}}
+
{{param|boolean|hasglyph|Whether the font can render all the UTF-8 characters in the string.}}
 +
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
hasglyph = Font:hasGlyph( codepoint )
+
hasglyphs = Font:hasGlyphs( character1, character2, ... )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|codepoint|A unicode codepoint number.}}
+
{{param|string|character1|A unicode character.}}
 +
{{param|string|character2|Another unicode character.}}
 
=== Returns ===
 
=== Returns ===
{{param|boolean|hasglyph|Whether the font can render the glyph represented by the codepoint number.}}
+
{{param|boolean|hasglyph|Whether the font can render all the glyphs represented by the characters.}}
 +
 
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
hasglyphs = Font:hasGlyphs( codepoint1, codepoint2, ... )
 +
</source>
 +
=== Arguments ===
 +
{{param|number|codepoint1|A unicode codepoint number.}}
 +
{{param|number|codepoint2|Another unicode codepoint number.}}
 +
=== Returns ===
 +
{{param|boolean|hasglyph|Whether the font can render all the glyphs represented by the codepoint numbers.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::Font]]
 
* [[parent::Font]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Gets whether the font can render a particular character.}}
+
{{#set:Description=Gets whether the Font can render a character or string.}}
 
== Other Languages ==
 
== Other Languages ==
{{i18n|Font:hasGlyph}}
+
{{i18n|Font:hasGlyphs}}

Latest revision as of 00:52, 29 October 2013

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

Gets whether the Font can render a character or string.

Function

Synopsis

hasglyphs = Font:hasGlyphs( text )

Arguments

string text
A UTF-8 encoded unicode string.

Returns

boolean hasglyph
Whether the font can render all the UTF-8 characters in the string.

Function

Synopsis

hasglyphs = Font:hasGlyphs( character1, character2, ... )

Arguments

string character1
A unicode character.
string character2
Another unicode character.

Returns

boolean hasglyph
Whether the font can render all the glyphs represented by the characters.

Function

Synopsis

hasglyphs = Font:hasGlyphs( codepoint1, codepoint2, ... )

Arguments

number codepoint1
A unicode codepoint number.
number codepoint2
Another unicode codepoint number.

Returns

boolean hasglyph
Whether the font can render all the glyphs represented by the codepoint numbers.

See Also

Other Languages