SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::TextBase Struct Reference

Text created with TextBase.TextBase() More...

Inheritance diagram for SDL::TextBase:
Inheritance graph
[legend]

Public Member Functions

void DrawSurface (Point p, SurfaceRef surface) const
 Draw text to an SDL surface.
 
void DrawRenderer (FPoint p) const
 Draw text to an SDL renderer.
 
GPUAtlasDrawSequenceGetGPUDrawData () const
 Get the geometry data needed for drawing the text.
 
 TextBase (TextEngineBase &engine, FontRef font, std::string_view text)
 Create a text object from UTF-8 text and a text engine.
 
PropertiesRef GetProperties () const
 Get the properties associated with a text object.
 
void SetEngine (TextEngineBase &engine)
 Set the text engine used by a text object.
 
TextEngineRef GetEngine () const
 Get the text engine used by a text object.
 
bool SetFont (FontBase &font)
 Set the font used by a text object.
 
FontRef GetFont () const
 Get the font used by a text object.
 
void SetDirection (Direction direction)
 Set the direction to be used for text shaping a text object.
 
Direction GetDirection () const
 Get the direction to be used for text shaping a text object.
 
void SetScript (Uint32 script)
 Set the script to be used for text shaping a text object.
 
Uint32 GetScript () const
 Get the script used for text shaping a text object.
 
void SetColor (Color c)
 Set the color of a text object.
 
void SetColor (FColor c)
 Set the color of a text object.
 
FColor GetColor () const
 Get the color of a text object.
 
void GetColor (Color *c) const
 Get the color of a text object.
 
void GetColor (FColor *c) const
 Get the color of a text object.
 
void GetColor (Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) const
 Get the color of a text object.
 
void GetColor (float *r, float *g, float *b, float *a) const
 Get the color of a text object.
 
bool SetPosition (Point p)
 Set the position of a text object.
 
Point GetPosition () const
 Get the position of a text object.
 
bool GetPosition (int *x, int *y) const
 Get the position of a text object.
 
void SetWrapWidth (int wrap_width)
 Set whether wrapping is enabled on a text object.
 
int GetWrapWidth () const
 Get whether wrapping is enabled on a text object.
 
void SetWrapWhitespaceVisible (bool visible)
 Set whether whitespace should be visible when wrapping a text object.
 
bool IsWrapWhitespaceVisible () const
 Return whether whitespace is shown when wrapping a text object.
 
void SetString (std::string_view string)
 Set the UTF-8 text used by a text object.
 
void InsertString (int offset, std::string_view string)
 Insert UTF-8 text into a text object.
 
void AppendString (std::string_view string)
 Append UTF-8 text to a text object.
 
void DeleteString (int offset, int length=-1)
 Delete UTF-8 text from a text object.
 
Point GetSize () const
 Get the size of a text object.
 
void GetSize (int *w, int *h) const
 Get the size of a text object.
 
void GetSubString (int offset, SubString *substring) const
 Get the substring of a text object that surrounds a text offset.
 
SubStringIterator begin () const
 Get iterator to first substring.
 
SubStringIterator end () const
 Get iterator to one past last substring.
 
SubStringIterator GetSubStringForLine (int line) const
 Get iterator to substring of a text object that contains the given line.
 
void GetSubStringForLine (int line, SubString *substring) const
 Get the substring of a text object that contains the given line.
 
OwnArray< SubString * > GetSubStrings () const
 Get all substrings of a text object.
 
OwnArray< SubString * > GetSubStringsForRange (int offset, int length=-1) const
 Get the substrings of a text object that contain a range of text.
 
SubStringIterator GetSubStringForPoint (Point p) const
 Get the portion of a text string that is closest to a point.
 
void GetSubStringForPoint (Point p, SubString *substring) const
 Get the portion of a text string that is closest to a point.
 
void GetPreviousSubString (const SubString &substring, SubString *previous) const
 Get the previous substring in a text object.
 
void GetNextSubString (const SubString &substring, SubString *next) const
 Get the next substring in a text object.
 
void Update ()
 Update the layout of a text object.
 
const char * GetText () const
 A copy of the UTF-8 string that this text object represents, useful for layout, debugging and retrieving substring text.
 
int GetNumLines () const
 The number of lines in the text, 0 if it's empty.
 
constexpr Resource (T resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
- Public Member Functions inherited from SDL::Resource< TTF_Text * >
constexpr Resource (TTF_Text * resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other)=delete
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr bool operator== (const Resource &other) const=default
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr TTF_Text * get () const
 Return contained resource;.
 
constexpr TTF_Text * release (TTF_Text * newResource={})
 Return contained resource and empties or replace value.
 
constexpr const TTF_Text * operator-> () const
 Access to fields.
 
constexpr TTF_Text * operator-> ()
 Access to fields.
 

Detailed Description

Since
This struct is available since SDL_ttf 3.0.0.
Category:
Resource
See also
TextBase.TextBase
TextBase.GetProperties
Text
TextRef

Constructor & Destructor Documentation

◆ TextBase()

SDL::TextBase::TextBase ( TextEngineBase engine,
FontRef  font,
std::string_view  text 
)
inline
Parameters
enginethe text engine to use when creating the text object, may be nullptr.
fontthe font to render with.
textthe text to use, in UTF-8 encoding.
Postcondition
a TextBase object or nullptr on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the font and text engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextRef.reset

Member Function Documentation

◆ AppendString()

void SDL::TextBase::AppendString ( std::string_view  string)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
stringthe UTF-8 text to insert.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.DeleteString
TextBase.InsertString
TextBase.SetString

◆ DeleteString()

void SDL::TextBase::DeleteString ( int  offset,
int  length = -1 
)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
offsetthe offset, in bytes, from the beginning of the string if >= 0, the offset from the end of the string if < 0. Note that this does not do UTF-8 validation, so you should only delete at UTF-8 sequence boundaries.
lengththe length of text to delete, in bytes, or -1 for the remainder of the string.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.AppendString
TextBase.InsertString
TextBase.SetString

◆ DrawRenderer()

void SDL::TextBase::DrawRenderer ( FPoint  p) const
inline

text must have been created using a TextEngineBase from CreateRendererTextEngine(), and will draw using the renderer passed to that function.

Parameters
pthe (x, y) coordinate in pixels, positive from the left edge towards the right and from the top edge towards the bottom.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
CreateRendererTextEngine
TextBase.TextBase

◆ DrawSurface()

void SDL::TextBase::DrawSurface ( Point  p,
SurfaceRef  surface 
) const
inline

text must have been created using a TextEngineBase from CreateSurfaceTextEngine().

Parameters
pthe (x, y) coordinate in pixels, positive from the left edge towards the right and from the top edge towards the bottom.
surfacethe surface to draw on.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
CreateSurfaceTextEngine
TextBase.TextBase

◆ GetColor() [1/5]

FColor SDL::TextBase::GetColor ( ) const
inline
Returns
The color in the range of 0-1 on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
See also
SetColor(FColor)

◆ GetColor() [2/5]

void SDL::TextBase::GetColor ( Color c) const
inline
Parameters
ca pointer filled in with red color value in the range of 0-255, must not be nullptr.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
SetColor(Color)

◆ GetColor() [3/5]

void SDL::TextBase::GetColor ( FColor c) const
inline
Parameters
ca pointer filled in with red color value in the range of 0-1, must not be nullptr.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
SetColor(FColor)

◆ GetColor() [4/5]

void SDL::TextBase::GetColor ( float *  r,
float *  g,
float *  b,
float *  a 
) const
inline
Parameters
ra pointer filled in with the red color value, normally in the range of 0-1, may be nullptr.
ga pointer filled in with the green color value, normally in the range of 0-1, may be nullptr.
ba pointer filled in with the blue color value, normally in the range of 0-1, may be nullptr.
aa pointer filled in with the alpha value in the range of 0-1, may be nullptr.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
SetColor(FColor)

◆ GetColor() [5/5]

void SDL::TextBase::GetColor ( Uint8 *  r,
Uint8 *  g,
Uint8 *  b,
Uint8 *  a 
) const
inline
Parameters
ra pointer filled in with the red color value in the range of 0-255, may be nullptr.
ga pointer filled in with the green color value in the range of 0-255, may be nullptr.
ba pointer filled in with the blue color value in the range of 0-255, may be nullptr.
aa pointer filled in with the alpha value in the range of 0-255, may be nullptr.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
SetColor(Color)

◆ GetDirection()

Direction SDL::TextBase::GetDirection ( ) const
inline

This defaults to the direction of the font used by the text object.

Returns
the direction to be used for text shaping.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetEngine()

TextEngineRef SDL::TextBase::GetEngine ( ) const
inline
Returns
the TextEngineBase used by the text on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.SetEngine

◆ GetFont()

FontRef SDL::TextBase::GetFont ( ) const
inline
Returns
the FontBase used by the text on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.SetFont

◆ GetGPUDrawData()

GPUAtlasDrawSequence * SDL::TextBase::GetGPUDrawData ( ) const
inline

text must have been created using a TextEngineBase from CreateGPUTextEngine().

The positive X-axis is taken towards the right and the positive Y-axis is taken upwards for both the vertex and the texture coordinates, i.e, it follows the same convention used by the SDL_GPU API. If you want to use a different coordinate system you will need to transform the vertices yourself.

If the text looks blocky use linear filtering.

Returns
a nullptr terminated linked list of GPUAtlasDrawSequence objects or nullptr if the passed text is empty or in case of failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
CreateGPUTextEngine
TextBase.TextBase

◆ GetNextSubString()

void SDL::TextBase::GetNextSubString ( const SubString substring,
SubString next 
) const
inline

If called at the end of the text, this will return a zero length substring with the SUBSTRING_TEXT_END flag set.

Parameters
substringthe SubString to query.
nexta pointer filled in with the next substring.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetPosition() [1/2]

Point SDL::TextBase::GetPosition ( ) const
inline
Returns
a Point with the offset of the upper left corner of this text in pixels on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
SetPosition()

◆ GetPosition() [2/2]

bool SDL::TextBase::GetPosition ( int *  x,
int *  y 
) const
inline
Parameters
xa pointer filled in with the x offset of the upper left corner of this text in pixels, may be nullptr.
ya pointer filled in with the y offset of the upper left corner of this text in pixels, may be nullptr.
Returns
true on success or false on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.SetPosition

◆ GetPreviousSubString()

void SDL::TextBase::GetPreviousSubString ( const SubString substring,
SubString previous 
) const
inline

If called at the start of the text, this will return a zero length substring with the SUBSTRING_TEXT_START flag set.

Parameters
substringthe SubString to query.
previousa pointer filled in with the previous substring.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetProperties()

PropertiesRef SDL::TextBase::GetProperties ( ) const
inline
Returns
a valid property ID on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetScript()

Uint32 SDL::TextBase::GetScript ( ) const
inline

This defaults to the script of the font used by the text object.

Returns
an ISO 15924 code or 0 if a script hasn't been set on either the text object or the font.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TagToString

◆ GetSize() [1/2]

Point SDL::TextBase::GetSize ( ) const
inline

The size of the text may change when the font or font style and size change.

Returns
Point containing the size on x and y axis on success or std::nullopt on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
GetSize(int*,int*) if might want only one of the coordinates

◆ GetSize() [2/2]

void SDL::TextBase::GetSize ( int *  w,
int *  h 
) const
inline

The size of the text may change when the font or font style and size change.

Parameters
wa pointer filled in with the width of the text, in pixels, may be nullptr.
ha pointer filled in with the height of the text, in pixels, may be nullptr.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
GetSize() if you need both coordinates.

◆ GetSubString()

void SDL::TextBase::GetSubString ( int  offset,
SubString substring 
) const
inline

If offset is less than 0, this will return a zero length substring at the beginning of the text with the SUBSTRING_TEXT_START flag set. If offset is greater than or equal to the length of the text string, this will return a zero length substring at the end of the text with the SUBSTRING_TEXT_END flag set.

Parameters
offseta byte offset into the text string.
substringa pointer filled in with the substring containing the offset.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStringForLine() [1/2]

SubStringIterator SDL::TextBase::GetSubStringForLine ( int  line) const
inline

If line is greater than or equal to text->num_lines this will return an iterator equal to end().

Parameters
linea zero-based line index, in the range [0 .. text->num_lines-1].
Returns
iterator on success or false on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStringForLine() [2/2]

void SDL::TextBase::GetSubStringForLine ( int  line,
SubString substring 
) const
inline

If line is less than 0, this will return a zero length substring at the beginning of the text with the SUBSTRING_TEXT_START flag set. If line is greater than or equal to text->num_lines this will return a zero length substring at the end of the text with the SUBSTRING_TEXT_END flag set.

Parameters
linea zero-based line index, in the range [0 .. text->num_lines-1].
substringa pointer filled in with the substring containing the offset.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStringForPoint() [1/2]

SubStringIterator SDL::TextBase::GetSubStringForPoint ( Point  p) const
inline

This will return the closest substring of text to the given point.

Parameters
pthe coordinates relative to the top-left side of the text, may be outside the bounds of the text area.
Returns
the iterator on success or false on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStringForPoint() [2/2]

void SDL::TextBase::GetSubStringForPoint ( Point  p,
SubString substring 
) const
inline

This will return the closest substring of text to the given point.

Parameters
pthe coordinates relative to the top-left side of the text, may be outside the bounds of the text area.
substringa pointer filled in with the closest substring of text to the given point.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStrings()

OwnArray< SubString * > SDL::TextBase::GetSubStrings ( ) const
inline
Returns
a nullptr terminated array of substring pointers or nullptr on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetSubStringsForRange()

OwnArray< SubString * > SDL::TextBase::GetSubStringsForRange ( int  offset,
int  length = -1 
) const
inline
Parameters
offseta byte offset into the text string.
lengththe length of the range being queried, in bytes, or -1 for the remainder of the string.
Returns
a nullptr terminated array of substring pointers or nullptr on failure; call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ GetWrapWidth()

int SDL::TextBase::GetWrapWidth ( ) const
inline
Returns
an int with the maximum width in pixels or 0 if the text is being wrapped on newline characters on success.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.SetWrapWidth

◆ InsertString()

void SDL::TextBase::InsertString ( int  offset,
std::string_view  string 
)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
offsetthe offset, in bytes, from the beginning of the string if >= 0, the offset from the end of the string if < 0. Note that this does not do UTF-8 validation, so you should only insert at UTF-8 sequence boundaries.
stringthe UTF-8 text to insert.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.AppendString
TextBase.DeleteString
TextBase.SetString

◆ IsWrapWhitespaceVisible()

bool SDL::TextBase::IsWrapWhitespaceVisible ( ) const
inline
Returns
true if whitespace is shown when wrapping text, or false otherwise.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.SetWrapWhitespaceVisible

◆ SetColor() [1/2]

void SDL::TextBase::SetColor ( Color  c)
inline

The default text color is white (255, 255, 255, 255).

Parameters
cthe color values in the range of 0-255.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetColor(Color*)
TextBase.SetColor(FColor)

◆ SetColor() [2/2]

void SDL::TextBase::SetColor ( FColor  c)
inline

The default text color is white (1.0f, 1.0f, 1.0f, 1.0f).

Parameters
cthe color value, normally in the range of 0-1.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetColor(FColor*)
TextBase.SetColor(Color)

◆ SetDirection()

void SDL::TextBase::SetDirection ( Direction  direction)
inline

This function only supports left-to-right text shaping if SDL_ttf was not built with HarfBuzz support.

Parameters
directionthe new direction for text to flow.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

◆ SetEngine()

void SDL::TextBase::SetEngine ( TextEngineBase engine)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
enginethe text engine to use for drawing.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetEngine

◆ SetFont()

bool SDL::TextBase::SetFont ( FontBase font)
inline

When a text object has a font, any changes to the font will automatically regenerate the text. If you set the font to nullptr, the text will continue to render but changes to the font will no longer affect the text.

This function may cause the internal text representation to be rebuilt.

Parameters
fontthe font to use, may be nullptr.
Returns
false if the text pointer is null; otherwise, true. call GetError() for more information.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetFont

◆ SetPosition()

bool SDL::TextBase::SetPosition ( Point  p)
inline

This can be used to position multiple text objects within a single wrapping text area.

This function may cause the internal text representation to be rebuilt.

Parameters
pthe x, y offset of the upper left corner of this text in pixels.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetPosition

◆ SetScript()

void SDL::TextBase::SetScript ( Uint32  script)
inline

This returns false if SDL_ttf isn't built with HarfBuzz support.

Parameters
scriptan ISO 15924 code.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
StringToTag

◆ SetString()

void SDL::TextBase::SetString ( std::string_view  string)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
stringthe UTF-8 text to use.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.AppendString
TextBase.DeleteString
TextBase.InsertString

◆ SetWrapWhitespaceVisible()

void SDL::TextBase::SetWrapWhitespaceVisible ( bool  visible)
inline

If the whitespace is visible, it will take up space for purposes of alignment and wrapping. This is good for editing, but looks better when centered or aligned if whitespace around line wrapping is hidden. This defaults false.

This function may cause the internal text representation to be rebuilt.

Parameters
visibletrue to show whitespace when wrapping text, false to hide it.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.IsWrapWhitespaceVisible

◆ SetWrapWidth()

void SDL::TextBase::SetWrapWidth ( int  wrap_width)
inline

This function may cause the internal text representation to be rebuilt.

Parameters
wrap_widththe maximum width in pixels, 0 to wrap on newline characters.
Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextBase.GetWrapWidth

◆ Update()

void SDL::TextBase::Update ( )
inline

This is automatically done when the layout is requested or the text is rendered, but you can call this if you need more control over the timing of when the layout and text engine representation are updated.

Exceptions
Erroron failure.
Thread safety:
This function should be called on the thread that created the text.
Since
This function is available since SDL_ttf 3.0.0.

The documentation for this struct was generated from the following file: