ttfGetTextSubStringsForRange function

Pointer<Pointer<TtfSubString>> ttfGetTextSubStringsForRange(
  1. Pointer<TtfText> text,
  2. int offset,
  3. int length,
  4. Pointer<Int32> count,
)

Get the substrings of a text object that contain a range of text.

\param text the TTF_Text to query. \param offset a byte offset into the text string. \param length the length of the range being queried, in bytes, or -1 for the remainder of the string. \param count a pointer filled in with the number of substrings returned, may be NULL. \returns a NULL terminated array of substring pointers or NULL on failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.

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

\since This function is available since SDL_ttf 3.0.0.

extern SDL_DECLSPEC TTF_SubString ** SDLCALL TTF_GetTextSubStringsForRange(TTF_Text *text, int offset, int length, int *count)

Implementation

Pointer<Pointer<TtfSubString>> ttfGetTextSubStringsForRange(
    Pointer<TtfText> text, int offset, int length, Pointer<Int32> count) {
  final ttfGetTextSubStringsForRangeLookupFunction = libSdl3Ttf.lookupFunction<
      Pointer<Pointer<TtfSubString>> Function(Pointer<TtfText> text,
          Int32 offset, Int32 length, Pointer<Int32> count),
      Pointer<Pointer<TtfSubString>> Function(Pointer<TtfText> text, int offset,
          int length, Pointer<Int32> count)>('TTF_GetTextSubStringsForRange');
  return ttfGetTextSubStringsForRangeLookupFunction(
      text, offset, length, count);
}