The OpenD Programming Language

FONSTextBoundsIterator

This iterator can be used to do text measurement.

Don't add new fonts to stash while you are iterating, or you WILL get segfault!

Constructors

this
this(FONSContext astash, float ax, float ay)

Initialize iterator with the current FontStash state. FontStash state can be changed after initialization without affecting the iterator.

Members

Functions

ascender
float ascender()

Returns font ascender (positive).

descender
float descender()

Returns font descender (negative).

getBounds
void getBounds(float[4] bounds)

Returns current text bounds.

getHBounds
void getHBounds(float xmin, float xmax)

Returns current horizontal text bounds.

getVBounds
void getVBounds(float ymin, float ymax)

Returns current vertical text bounds.

lineHeight
float lineHeight()

Returns font line height.

put
void put(const(T)[] str)

Put some text into iterator, calculate new values.

reset
void reset(FONSContext astash, float ax, float ay)

(Re)initialize iterator with the current FontStash state. FontStash state can be changed after initialization without affecting the iterator.

Properties

advance
float advance [@property getter]

Returns current advance.

valid
bool valid [@property getter]

Can this iterator be used?

See Also

Meta