ttfSetFontSizeDpi function

int ttfSetFontSizeDpi(
  1. Pointer<TtfFont> font,
  2. int ptsize,
  3. int hdpi,
  4. int vdpi,
)

Set font size dynamically with target resolutions (in DPI).

This clears already-generated glyphs, if any, from the cache.

\param font the font to resize. \param ptsize the new point size. \param hdpi the target horizontal DPI. \param vdpi the target vertical DPI. \returns 0 if successful, -1 on error.

\since This function is available since SDL_ttf 2.0.18.

extern DECLSPEC int SDLCALL TTF_SetFontSizeDPI(TTF_Font *font, int ptsize, unsigned int hdpi, unsigned int vdpi)

Implementation

int ttfSetFontSizeDpi(Pointer<TtfFont> font, int ptsize, int hdpi, int vdpi) {
  final ttfSetFontSizeDpiLookupFunction = libSdl2Ttf.lookupFunction<
      Int32 Function(
          Pointer<TtfFont> font, Int32 ptsize, Uint32 hdpi, Uint32 vdpi),
      int Function(Pointer<TtfFont> font, int ptsize, int hdpi,
          int vdpi)>('TTF_SetFontSizeDPI');
  return ttfSetFontSizeDpiLookupFunction(font, ptsize, hdpi, vdpi);
}