ttfGetFontDpi function

bool ttfGetFontDpi(
  1. Pointer<TtfFont> font,
  2. Pointer<Int32> hdpi,
  3. Pointer<Int32> vdpi
)

Get font target resolutions, in dots per inch.

\param font the font to query. \param hdpi a pointer filled in with the target horizontal DPI. \param vdpi a pointer filled in with the target vertical DPI. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should be called on the thread that created the font.

\since This function is available since SDL_ttf 3.0.0.

\sa TTF_SetFontSizeDPI

extern SDL_DECLSPEC bool SDLCALL TTF_GetFontDPI(TTF_Font *font, int *hdpi, int *vdpi)

Implementation

bool ttfGetFontDpi(
    Pointer<TtfFont> font, Pointer<Int32> hdpi, Pointer<Int32> vdpi) {
  final ttfGetFontDpiLookupFunction = libSdl3Ttf.lookupFunction<
      Uint8 Function(
          Pointer<TtfFont> font, Pointer<Int32> hdpi, Pointer<Int32> vdpi),
      int Function(Pointer<TtfFont> font, Pointer<Int32> hdpi,
          Pointer<Int32> vdpi)>('TTF_GetFontDPI');
  return ttfGetFontDpiLookupFunction(font, hdpi, vdpi) == 1;
}