Class FreeTypeFont
Font implementation based on FreeType.
Constructors
| Name | Description |
|---|---|
this
(item, size)
|
need to call create() after construction to initialize font |
Fields
| Name | Type | Description |
|---|---|---|
_allowKerning
|
bool | |
_refCount
|
int | count of references to this object from Ref |
_spaceWidth
|
int | |
_textSizeBuffer
|
int[] | Buffer to reuse while measuring strings to avoid GC |
Properties
| Name | Type | Description |
|---|---|---|
allowKerning[get]
|
bool | override to allow kerning |
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 |
allowKerning[set]
|
bool | override to enable kerning support |
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 |
Methods
| 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
(code, def_char, index, file)
|
find glyph index for character |
getCharGlyph
(ch, withImage)
|
get character glyph information |
getGlyphIndex
(code)
|
|
getKerningOffset
(prevChar, currentChar)
|
override to implement kerning offset calculation |
addRef
()
|
increments reference counter |
charWidth
(ch)
|
returns character width |
drawMultilineText
(buf, x, y, text, color, maxLines, maxWidth, tabSize, tabOffset, textFlags)
|
draws multiline text with line splitting |
drawStyledText
(buf, x, y, text, charProps, tabSize, tabOffset, textFlags)
|
Draw text string to buffer. |
drawText
(buf, x, y, text, color, tabSize, tabOffset, textFlags)
|
Draw text string to buffer. |
measureMultilineText
(text, maxLines, maxWidth, tabSize, tabOffset, textFlags)
|
measure multiline text with line splitting, returns width and height in pixels |
measureText
(text, widths, maxWidth, tabSize, tabOffset, textFlags)
|
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
(text, maxWidth, tabSize, tabOffset, textFlags)
|
Measure text string as single line, returns width and height |
textSizeImpl
(font, text, maxWidth, tabSize, tabOffset, textFlags)
|
Aliases
| Name | Description |
|---|---|
~this
|
|
textSizeMemoized
|