Module ui.font
Font module.
Functions
Font:getFace (font, size, faceindex) | 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, faceindex)
-
Gets font face object.
Parameters:
- font string
- size integer optional size
- faceindex integer optional index of font face in font file
Returns:
- 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:
- provided ui.font.FontFaceObj face font face
- bold boolean whether bold is requested
Returns:
- ui.font.FontFaceObj face face to use for drawing
- bool bold adjusted bold properties