Font.this - multiple declarations

Function Font.this

Constructs a Font from a vanilla TTF_Font* from bindbc-sdl

this (
  sdl_ttf.TTF_Font* ttfFont,
  bool isOwner = true,
  void* userRef = null
);

Parameters

NameDescription
ttfFont the TTF_Font pointer to manage
isOwner whether the instance owns the given TTF_Font* and should destroy it on its own
userRef optional pointer to maintain reference link, avoiding GC cleanup

Function Font.this

Loads a Font from a font file, which wraps TTF_OpenFont

this (
  string file,
  uint size
) @trusted;

Parameters

NameDescription
file path to the font file
size point size of the loaded font

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a font file with a face index, which wraps TTF_OpenFontIndex

this (
  string file,
  uint size,
  ulong index
) @trusted;

Parameters

NameDescription
file path to the font file
size point size of the loaded font
index face index of the loaded font

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a buffer, which wraps TTF_OpenFontRW

this (
  const(void[]) data,
  uint size
) @trusted;

Parameters

NameDescription
data buffer of the font file
size point size of the loaded font

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a buffer with a face index, which wraps TTF_OpenFontIndexRW

this (
  const(void[]) data,
  uint size,
  ulong index
) @trusted;

Parameters

NameDescription
data buffer of the font file
size point size of the loaded font
index face index of the loaded font

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a font file with DPI, which wraps TTF_OpenFontDPI (from SDL_ttf 2.0.18)

this (
  string file,
  uint size,
  uint hdpi,
  uint vdpi
) @trusted;

Parameters

NameDescription
file path to the font file
size point size of the loaded font
hdpi target horizontal DPI
vdpi target vertical DPI

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a font file with DPI and face index, which wraps TTF_OpenFontIndexDPI (from SDL_ttf 2.0.18)

this (
  string file,
  uint size,
  ulong index,
  uint hdpi,
  uint vdpi
) @trusted;

Parameters

NameDescription
file path to the font file
size point size of the loaded font
index face index of the loaded font
hdpi target horizontal DPI
vdpi target vertical DPI

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a buffer with DPI, which wraps TTF_OpenFontDPIRW (from SDL_ttf 2.0.18)

this (
  const(void[]) data,
  uint size,
  uint hdpi,
  uint vdpi
) @trusted;

Parameters

NameDescription
data buffer of the font file
size point size of the loaded font
hdpi target horizontal DPI
vdpi target vertical DPI

Throws

dsdl2.SDLException if unable to load the font

Function Font.this

Loads a Font from a buffer with DPI and face index, which wraps TTF_OpenFontIndexDPIRW (from SDL_ttf 2.0.18)

this (
  const(void[]) data,
  uint size,
  ulong index,
  uint hdpi,
  uint vdpi
) @trusted;

Parameters

NameDescription
data buffer of the font file
size point size of the loaded font
index face index of the loaded font
hdpi target horizontal DPI
vdpi target vertical DPI

Throws

dsdl2.SDLException if unable to load the font