Module ncine.font
The table containing font related functions
Functions
ncine.font.new (fnt_file, texture_file) | Constructs the font object from an AngelCode’s FNT file and a texture file. |
ncine.font.delete (font) | Destroys a font object and releases its memory |
ncine.font.get_texture (font) | Returns the texture object in use by the font |
ncine.font.set_texture (font, texture) | Sets a new shared texture object without modifying any glyphs or kerning data |
ncine.font.get_line_height (font) | Returns the font line height |
ncine.font.get_base (font) | Returns the font base |
ncine.font.get_texture_size (font) | Returns the texture atlas size |
ncine.font.num_glyphs (font) | Returns the number of glyphs |
ncine.font.num_kernings (font) | Returns the number of kerning pairs |
ncine.font.get_render_mode (font) | Returns the mode detected by the font to render text nodes |
Tables
fontObj | The light user data of a font object |
ncine.font_render_mode | Font rendering modes (enumeration) |
Functions
- ncine.font.new (fnt_file, texture_file)
-
Constructs the font object from an AngelCode’s
FNT
file and a texture file.If the
texture_file
parameter is an empty string, then a texture with the same name as theFNT
file is searched in the same path.Don’t forget to call ncine.font.delete when you are done with it!
Parameters:
Returns:
-
fontObj
A new font object
- ncine.font.delete (font)
-
Destroys a font object and releases its memory
Parameters:
- font fontObj The font object to be destroyed
- ncine.font.get_texture (font)
-
Returns the texture object in use by the font
Parameters:
- font fontObj
Returns:
-
ncine.texture.textureObj or nil
- ncine.font.set_texture (font, texture)
-
Sets a new shared texture object without modifying any glyphs or kerning data
Parameters:
- font fontObj
- texture ncine.texture.textureObj or nil
- ncine.font.get_line_height (font)
-
Returns the font line height
Parameters:
- font fontObj
Returns:
-
integer
- ncine.font.get_base (font)
-
Returns the font base
Parameters:
- font fontObj
Returns:
-
integer
- ncine.font.get_texture_size (font)
-
Returns the texture atlas size
Parameters:
- font fontObj
Returns:
-
ncine.vec2
- ncine.font.num_glyphs (font)
-
Returns the number of glyphs
Parameters:
- font fontObj
Returns:
-
integer
- ncine.font.num_kernings (font)
-
Returns the number of kerning pairs
Parameters:
- font fontObj
Returns:
-
integer
- ncine.font.get_render_mode (font)
-
Returns the mode detected by the font to render text nodes
Parameters:
- font fontObj
Returns:
-
ncine.font_render_mode