Font.measureText - multiple declarations

Function Font.measureText

Wraps TTF_MeasureUTF8 (from SDL_ttf 2.0.18) to calculate the maximum number of characters from a text that can be rendered given a maximum fitting width

std.typecons.Tuple!(uint,"extent",uint,"count") measureText (
  string text,
  uint measureWidth
) @trusted const;

Parameters

NameDescription
text string of characters to measure
measureWidth maximum fitting width

Returns

named tuple of extent (calculated width) and count (number of characters)

Throws

dsdl.SDLException if unable to measure text

Function Font.measureText

Wraps TTF_MeasureUNICODE (from SDL_ttf 2.0.18) to calculate the maximum number of characters from a text that can be rendered given a maximum fitting width

std.typecons.Tuple!(uint,"extent",uint,"count") measureText (
  wstring text,
  uint measureWidth
) @trusted const;

Parameters

NameDescription
text wstring of characters to measure
measureWidth maximum fitting width

Returns

named tuple of extent (calculated width) and count (number of characters)

Throws

dsdl.SDLException if unable to measure text