gfm



class  SDLTTF;

SDL_ttf library wrapper.


this(SDL2 sdl2);

Loads the SDL_ttf library.

Throws
SDL2Exception on error.

class  SDLFont;

SDL_ttf loaded font wrapper.


this(SDLTTF sdlttf, string filename, int ptSize);

Loads a font from a file.

Parameters
SDLTTF sdlttf library object.
string filename path of the font file.
int ptSize font size in 72 dpi ("This basically translates to pixel height" says the doc).
Throws
SDL2Exception on error.

int  style();

Returns
Font  style.

int  setStyle(int newStyle);

Set font style.


int  hinting();

Returns
Font  hinting.

int  setHinting(int newHinting);

Set font hinting.


int  outline();

Returns
Font  outline.

int  setOutline(int newOutline);

Set font outline.


bool  getKerning();

Returns
true if kerning is enabled.

bool  setKerning(bool enabled);

Enables/Disables font kerning.


int  height();

Returns
Maximum  height of a glyph in pixels.

int  ascent();

Returns
Height above baseline in pixels.

int  descent();

Returns
Height below baseline.

int  lineSkip();

Returns
Line skip, the recommended pixel interval between two lines.

SDL_Point  measureText(string text);

Returns
Size of text in pixels if rendered with this font.

SDL2Surface  renderGlyphBlended(dchar ch, SDL_Color color);

Create a 32-bit ARGB surface and render the given character at high quality,

using alpha blending to dither the font with the given color.

Throws
SDL2Exception on error.

SDL2Surface  renderTextBlended(string text, SDL_Color color);

Create a 32-bit ARGB surface and render the given text at high quality,

using alpha blending to dither the font with the given color.

Throws
SDL2Exception on error.

SDL2Surface  renderTextSolid(string text, SDL_Color color);

Create an 8-bit palettized surface and render the given text at fast

quality with the given font and color.

Throws
SDL2Exception on error.

SDL2Surface  renderTextShaded(string text, SDL_Color fg, SDL_Color bg);

Create an 8-bit palettized surface and render the given text at high

quality with the given font and colors.

Throws
SDL2Exception on error.

SDL2Surface  renderTextBlendedWrapped(string text, SDL_Color color, uint wrapLength);

Create a 32-bit ARGB surface and render the given text at high quality,

using alpha blending to dither the font with the given color.

Uses multi-line text wrapping.

Throws
SDL2Exception on error.