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 the FNT file is searched in the same path.

Don’t forget to call ncine.font.delete when you are done with it!

Parameters:

  • fnt_file string The path to a FNT file
  • texture_file string The path to a texture file

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:

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:

ncine.font.get_line_height (font)
Returns the font line height

Parameters:

Returns:

    integer
ncine.font.get_base (font)
Returns the font base

Parameters:

Returns:

    integer
ncine.font.get_texture_size (font)
Returns the texture atlas size

Parameters:

Returns:

    ncine.vec2
ncine.font.num_glyphs (font)
Returns the number of glyphs

Parameters:

Returns:

    integer
ncine.font.num_kernings (font)
Returns the number of kerning pairs

Parameters:

Returns:

    integer
ncine.font.get_render_mode (font)
Returns the mode detected by the font to render text nodes

Parameters:

Returns:

    ncine.font_render_mode

Tables

fontObj
The light user data of a font object
ncine.font_render_mode
Font rendering modes (enumeration)

Fields:

  • GLYPH_IN_ALPHA
  • GLYPH_IN_RED
  • GLYPH_SPRITE
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56