Skip to content

Commit

Permalink
Sync SDL3_ttf wiki -> header
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Oct 3, 2024
1 parent 86240ed commit b9ec674
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions include/SDL3_ttf/SDL_ttf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1707,10 +1707,10 @@ typedef struct TTF_SubString
/**
* Get the substring of a text object that surrounds a text offset.
*
* If `offset` is less than 0, this will return a zero width substring at
* the beginning of the text. If `offset` is greater than or equal to the
* length of the text string, this will return a zero width substring at the
* end of the text.
* If `offset` is less than 0, this will return a zero width substring at the
* beginning of the text. If `offset` is greater than or equal to the length
* of the text string, this will return a zero width substring at the end of
* the text.
*
* \param text the TTF_Text to query.
* \param offset a byte offset into the text string.
Expand All @@ -1724,11 +1724,15 @@ extern SDL_DECLSPEC bool SDLCALL TTF_GetTextSubString(TTF_Text *text, int offset
/**
* Get the substring of a text object that contains the given line.
*
* If `line` is less than 0, this will return a zero width substring at the beginning of the text. If `line` is greater than or equal to `text->num_lines` this will return a zero width substring at the end of the text.
* If `line` is less than 0, this will return a zero width substring at the
* beginning of the text. If `line` is greater than or equal to
* `text->num_lines` this will return a zero width substring at the end of the
* text.
*
* \param text the TTF_Text to query.
* \param line a zero-based line index, in the range [0 .. text->num_lines-1].
* \param substring a pointer filled in with the substring containing the offset.
* \param substring a pointer filled in with the substring containing the
* offset.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*/
Expand All @@ -1737,19 +1741,24 @@ extern SDL_DECLSPEC bool SDLCALL TTF_GetTextSubStringForLine(TTF_Text *text, int
/**
* Get the substrings of a text object that contain a range of text.
*
* The smaller offset will be clamped to 0 and the larger offset will be clamped to the length of text minus 1. The substrings that are returned will include the first offset and the second offset inclusive, e.g. {0, 2} of "abcd" will return "abc". If the text is empty, this will return a single zero width substring.
* The smaller offset will be clamped to 0 and the larger offset will be
* clamped to the length of text minus 1. The substrings that are returned
* will include the first offset and the second offset inclusive, e.g. {0, 2}
* of "abcd" will return "abc". If the text is empty, this will return a
* single zero width substring.
*
* If an offset is negative, it will be considered as an offset from the end of the text, so {0, -1} would return substrings for the entire text.
* If an offset is negative, it will be considered as an offset from the end
* of the text, so {0, -1} would return substrings for the entire text.
*
* \param text the TTF_Text to query.
* \param offset1 the first byte offset into the text string.
* \param offset2 the second byte offset into the text 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.
* \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.
*/
extern SDL_DECLSPEC TTF_SubString ** SDLCALL TTF_GetTextSubStringsForRange(TTF_Text *text, int offset1, int offset2, int *count);

Expand All @@ -1763,7 +1772,8 @@ extern SDL_DECLSPEC TTF_SubString ** SDLCALL TTF_GetTextSubStringsForRange(TTF_T
* outside the bounds of the text area.
* \param y the y coordinate relative to the top side of the text, may be
* outside the bounds of the text area.
* \param substring a pointer filled in with the closest substring of text to the given point.
* \param substring a pointer filled in with the closest substring of text to
* the given point.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*/
Expand Down

0 comments on commit b9ec674

Please sign in to comment.