Font

Font. Using NanoVG.

Constructors

this
this()
Undocumented in source.
this
this(NVGcontext* nvgContext, int fontId, string fontName)

Font constructor.

Members

Functions

dispose
void dispose()
Undocumented in source. Be warned that the author may not have intended to support it.
draw
void draw(wstring text, vec2 position, Color color, int fontSize, bool shadow, int alignment)

Renders text.

draw
void draw(string text, vec2 position, Color color, int fontSize, bool shadow, int alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
draw
void draw(string text, float x, float y, Color color, int fontSize, bool shadow, int alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
draw
void draw(wstring text, float x, float y, Color color, int fontSize, bool shadow, int alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
draw
void draw(immutable(char)* data, float x, float y, Color color, int fontSize, bool shadow, int alignment)
Undocumented in source. Be warned that the author may not have intended to support it.
getGlyphPosition
NVGglyphPosition getGlyphPosition(uint index, float textX, wstring text, int fontSize)

Returns glyph position in text.

getTextBounds
float[4] getTextBounds(wstring text, float x, int fontSize)

Measures the specified text string. Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] Measured values are returned in local coordinate space.

getTextBounds
float[4] getTextBounds(string text, float x, int fontSize)
Undocumented in source. Be warned that the author may not have intended to support it.
getTextBounds
float[4] getTextBounds(immutable(char)* data, float x, int fontSize)
Undocumented in source. Be warned that the author may not have intended to support it.
getTextHeight
uint getTextHeight(wstring text)

Computes text height.

getTextWidth
uint getTextWidth(wstring text)

Computes text width.

Mixins

__anonymous
mixin JsonizeMe
Undocumented in source.

Properties

id
int id [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
name
string name [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
size
ushort size [@property getter]

Properties

size
ushort size [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

load
Font load(string fileName, NVGcontext* nvg)

Loads font.

Inherited Members

From IAsset

load
void load(string fileName, ...)
Undocumented in source.
dispose
void dispose()
Undocumented in source.

Meta