Naev

Module font

Lua bindings to interact with fonts.

Functions

__gc (font) Frees a font.
__eq (f1, f2) Compares two fonts to see if they are the same.
new (fontname[, Number=1.]) Gets a font.
height (f) Gets the height of a font.
width (f, text) Gets the width of some text for a font.
setFilter (font, min[, mag]) Sets the font minification and magnification filters.
addFallback (font, filename[, prefix=""]) Adds a fallback to a font.


Functions

__gc (font)
Frees a font.

Parameters:

  • font Font Font to free.
__eq (f1, f2)
Compares two fonts to see if they are the same.

Parameters:

  • f1 Font Font 1 to compare.
  • f2 Font Font 2 to compare.

Returns:

    boolean true if both fonts are the same.
new (fontname[, Number=1.])
Gets a font.

Parameters:

  • fontname String or Number Name of the font.
  • Number size Font height. (default 1.)

Returns:

  1. Font A newly created font.
  2. String Name of the newly created font.
  3. String Prefix of the newly created font.
height (f)
Gets the height of a font.

Parameters:

  • f Font Font to get the height of.

Returns:

    number Height of the font.
width (f, text)
Gets the width of some text for a font.

Parameters:

  • f Font Font to use.
  • text string Text to get width of.

Returns:

    number Height of the font.
setFilter (font, min[, mag])
Sets the font minification and magnification filters.

Parameters:

  • font Font Font to set filter.
  • min string Minification filter ("nearest" or "linear")
  • mag string Magnification filter ("nearest" or "linear"). Defaults to min. (optional)
addFallback (font, filename[, prefix=""])
Adds a fallback to a font.

Parameters:

  • font Font Font to set fallback to.
  • filename string Name of the font to add.
  • prefix string Prefix to use for the fonts. (default "")
generated by LDoc 1.5.0 Last updated 2024-11-21 07:14:26