Font

A font

Constructors

this
this(string file, int size, int canvasSize)

Constructs a new font

this
this(ubyte[] memFace, int size, int canvasSize)

Constructs a new font

Destructor

~this
~this()

Destroys the font

Members

Functions

advance
vec2 advance(dchar glyph)

Gets the advance of a glyph

changeSize
void changeSize(int size)

Changes size of font

draw
void draw(dstring text, vec2 position, vec4 color)

Basic string draw function

draw
void draw(dchar c, vec2 position, vec2 origin, float rotation, vec4 color)

draws a character

flush
void flush()

Flush font rendering

getMetrics
vec2 getMetrics()

Gets the font metrics

measure
vec2 measure(dstring text)

Measure size (width, height) of rectangle needed to contain the specified text

Meta