Module ui.font

Font module.

Functions

Font:getFace (font, size) Gets font face object.
Font:getAdjustedFace (provided, bold) Returns an alternative face instance to be used for measuring and drawing (in most cases, the one provided untouched)

If 'bold' is true, or if 'face' is a real bold face, we may need to use an alternative instance of the font, with possibly the associated real bold font, and/or with tweaks so fallback fonts are rendered bold too, without affecting the regular 'face'.

Tables

FontFaceObj Freetype font face wrapper object


Functions

Font:getFace (font, size)
Gets font face object.

Parameters:

  • font string
  • size int optional size

Returns:

    table FontFaceObj
Font:getAdjustedFace (provided, bold)
Returns an alternative face instance to be used for measuring and drawing (in most cases, the one provided untouched)

If 'bold' is true, or if 'face' is a real bold face, we may need to use an alternative instance of the font, with possibly the associated real bold font, and/or with tweaks so fallback fonts are rendered bold too, without affecting the regular 'face'. (This function should only be used by TextWidget and TextBoxWidget. Other widgets should not use it, and neither _getFallbackFont() which will do its own processing.)

Parameters:

Returns:

  1. ui.font.FontFaceObj face face to use for drawing
  2. bool bold adjusted bold properties

Tables

FontFaceObj
Freetype font face wrapper object

Fields:

  • orig_font font name requested
  • size size of the font face (after scaled by screen size)
  • orig_size raw size of the font face (before scale)
  • ftface font face object from freetype
  • hash hash key for this font face
generated by LDoc 1.4.6 Last updated 2020-03-29 12:40:26