Font

Instance of font with specific size, weight, face, etc.

Allows to measure text string and draw it on DrawBuf

Use FontManager.instance.getFont() to retrieve font instance.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

charWidth
int charWidth(dchar ch)

returns character width

checkpoint
void checkpoint()

clear usage flags for all entries

cleanup
void cleanup()

removes entries not used after last call of checkpoint() or cleanup()

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
clearGlyphCache
void clearGlyphCache()

clears glyph cache

drawColoredText
void drawColoredText(DrawBuf buf, int x, int y, dchar[] text, CustomCharProps[] charProps, int tabSize, int tabOffset, uint textFlags)

Draw text string to buffer.

drawMultilineText
void drawMultilineText(DrawBuf buf, int x, int y, dchar[] text, uint color, int maxLines, int maxWidth, int tabSize, int tabOffset, uint textFlags)

draws multiline text with line splitting

drawText
void drawText(DrawBuf buf, int x, int y, dchar[] text, uint color, int tabSize, int tabOffset, uint textFlags)

Draw text string to buffer.

getCharGlyph
Glyph* getCharGlyph(dchar ch, bool withImage)

get character glyph information

measureMultilineText
Point measureMultilineText(dchar[] text, int maxLines, int maxWidth, int tabSize, int tabOffset, uint textFlags)

measure multiline text with line splitting, returns width and height in pixels

measureText
int measureText(dchar[] text, int[] widths, int maxWidth, int tabSize, int tabOffset, uint textFlags)

Measure text string, return accumulated widths[] (distance to end of n-th character), returns number of measured chars.

textSize
Point textSize(dchar[] text, int maxWidth, int tabSize, int tabOffset, uint textFlags)

Measure text string as single line, returns width and height

Properties

antialiased
bool antialiased [@property getter]

return true if antialiasing is enabled, false if not enabled

baseline
int baseline [@property getter]

returns baseline offset

face
string face [@property getter]

returns font face name

family
FontFamily family [@property getter]

returns font family

height
int height [@property getter]

returns actual font height including interline space

isFixed
bool isFixed [@property getter]

returns true if font has fixed pitch (all characters have equal width)

isNull
bool isNull [@property getter]

returns true if font object is not yet initialized / loaded

italic
bool italic [@property getter]

returns true if font is italic

size
int size [@property getter]

returns font size (as requested from font engine)

spaceWidth
int spaceWidth [@property getter]

returns true if font is fixed

weight
int weight [@property getter]

returns font weight

Variables

_spaceWidth
int _spaceWidth;
Undocumented in source.
_textSizeBuffer
int[] _textSizeBuffer;
Undocumented in source.

Meta