Font

Font is the low-level class for loading and manipulating character fonts. This class is meant to be used by Dgame.Graphic.Text.

Constructors

this
this(string filename, ubyte fontSize)

CTor

Destructor

~this
~this()

DTor

Postblit

this(this)
@disable this(this)

Postblit is disabled

Copying this object is disabled.

Members

Enums

Mode
enum Mode

Available Font modes

Style
enum Style

Available Font styles

Functions

getStyle
Style getStyle()

Returns the current Font style.

loadFromFile
bool loadFromFile(string filename, ubyte fontSize)

Load the font from a file. Returns if the loading was successful. If not, an error message is shown, which describes the problem. If the second parameter isn't 0, the current font size will be replaced with that. If the current size is also 0, the DefaultSize (10) will be used.

render
Surface render(string text, const Color4b fg, const Color4b bg, Mode mode = Mode.Solid)

Draws the text on a Surface by using this Font and the given Mode (default is Mode.Solid) The text (and the Surface) is colorized by fg / bg Color.

setStyle
void setStyle(Style style)

Set the Font style.

Variables

DefaultSize
enum ubyte DefaultSize;

The default size of every Font is 10

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)