Class FreeTypeFont

Font implementation based on FreeType.

Inherits from


Name Description
this need to call create() after construction to initialize font


Name Type Description
_refCount int count of references to this object from Ref


Name Type Description
baseline [get] int returns baseline offset
face [get] string returns font face name
family [get] FontFamily returns font family
height [get] int returns actual font height including interline space
isNull [get] bool returns true if font object is not yet initialized / loaded
italic [get] bool returns true if font is italic
size [get] int returns font size (as requested from font engine)
weight [get] int returns font weight
antialiased [get] bool return true if antialiasing is enabled, false if not enabled
isFixed [get] bool returns true if font has fixed pitch (all characters have equal width)
refCount [get] int returns current value of reference counter
spaceWidth [get] int returns true if font is fixed


Name Description
checkpoint clear usage flags for all entries
cleanup removes entries not used after last call of checkpoint() or cleanup()
clear cleanup resources
clearGlyphCache clears glyph cache
create load font files
findGlyph find glyph index for character
getCharGlyph get character glyph information
addRef increments reference counter
charWidth returns character width
drawColoredText Draw text string to buffer.
drawMultilineText draws multiline text with line splitting
drawText Draw text string to buffer.
measureMultilineText measure multiline text with line splitting, returns width and height in pixels
measureText Measure text string, return accumulated widths[] (distance to end of n-th character), returns number of measured chars.
releaseRef decrement reference counter, destroy object if no more references left
textSize Measure text string as single line, returns width and height


Vadim Lopatin,


Vadim Lopatin, 2014


Boost License 1.0