The IText property interface. More...

#include "murl_graph_i_text.h"

Inheritance diagram for Murl::Graph::IText:

Public Member Functions

virtual IFontResourceTargetGetFontResourceTarget ()=0
 Get a mutable Graph::IFontResourceTarget container. More...
 
virtual const IFontResourceTargetGetFontResourceTarget () const =0
 Get a constant Graph::IFontResourceTarget container. More...
 
virtual ITextStyleNodeTargetGetTextStyleNodeTarget ()=0
 Get the optional mutable Graph::ITextStyleNodeTarget container. More...
 
virtual const ITextStyleNodeTargetGetTextStyleNodeTarget () const =0
 Get the optional constant Graph::ITextStyleNodeTarget container. More...
 
virtual Bool SetSystemFontName (const String &fontName)=0
 Set the ID of the system font used to render the text. More...
 
virtual const StringGetSystemFontName () const =0
 Get the ID of the system font used to render the text. More...
 
virtual Bool SetFontType (IEnums::FontType fontType)=0
 Set the type of font used for rendering. More...
 
virtual IEnums::FontType GetFontType () const =0
 Get the type of font used for rendering. More...
 
virtual Bool SetFontSize (Real fontSize)=0
 Set the font size. More...
 
virtual Real GetFontSize () const =0
 Get the font size. More...
 
virtual Bool SetTextColor (const Color &textColor)=0
 Set the foreground (text) color used for rendering the text. More...
 
virtual const ColorGetTextColor () const =0
 Get the text color. More...
 
virtual Bool SetBackgroundColor (const Color &backgroundColor)=0
 Set the background color used for rendering. More...
 
virtual const ColorGetBackgroundColor () const =0
 Get the background color. More...
 
virtual ITextNodeTargetGetParentTextNodeTarget ()=0
 Get the optional mutable Graph::ITextNodeTarget parent container. More...
 
virtual const ITextNodeTargetGetParentTextNodeTarget () const =0
 Get the optional constant Graph::ITextNodeTarget parent container. More...
 
virtual ITextureNodeTargetGetOutputTextureNodeTarget ()=0
 Get the optional mutable output Graph::ITextureNodeTarget container. More...
 
virtual const ITextureNodeTargetGetOutputTextureNodeTarget () const =0
 Get the optional constant output Graph::ITextureNodeTarget container. More...
 
virtual ITextResourceTargetGetTextResourceTarget ()=0
 Get a mutable Graph::ITextResourceTarget container. More...
 
virtual const ITextResourceTargetGetTextResourceTarget () const =0
 Get a constant Graph::ITextResourceTarget container. More...
 
virtual Bool SetText (const String &text)=0
 Set the text to be displayed. More...
 
virtual const StringGetText () const =0
 Get the displayed text. More...
 
virtual Bool SetTextHintEnabled (IEnums::TextHint hint, Bool enabled)=0
 Enable/disable a given text hint. More...
 
virtual Bool IsTextHintEnabled (IEnums::TextHint hint) const =0
 Check if a given trigger condition is enabled. More...
 
virtual Bool SetSpacing (Real spacing)=0
 Set the character spacing value. More...
 
virtual Real GetSpacing () const =0
 Get the character spacing value. More...
 
virtual Bool SetLeading (Real leading)=0
 Set the leading value. More...
 
virtual Real GetLeading () const =0
 Get the leading value. More...
 
virtual Bool SetEmbolding (Real strength)=0
 Set the embolding strength value. More...
 
virtual Real GetEmbolding () const =0
 Get the embolding strength value. More...
 
virtual Bool SetBlur (Real strength)=0
 Set the blur strength value. More...
 
virtual Real GetBlur () const =0
 Get the blur strength value. More...
 
virtual Bool SetSpaceWidthFactor (Real factor)=0
 Set the space width factor. More...
 
virtual Real GetSpaceWidthFactor () const =0
 Get the space width factor. More...
 
virtual Bool SetDigitWidthFactor (Real factor)=0
 Set the digit width factor. More...
 
virtual Real GetDigitWidthFactor () const =0
 Get the digit width factor. More...
 
virtual Bool SetSameDigitWidthEnabled (Bool enabled)=0
 Enable/disable unified digit width. More...
 
virtual Bool IsSameDigitWidthEnabled () const =0
 Check if unified digit width is enabled. More...
 
virtual Bool SetWordWrappingEnabled (Bool enabled)=0
 Enable/disable word wrapping. More...
 
virtual Bool IsWordWrappingEnabled () const =0
 Check if word wrapping is enabled. More...
 
virtual Bool SetTextAlignmentX (IEnums::TextAlignmentX alignment)=0
 Set the horizontal text alignment. More...
 
virtual IEnums::TextAlignmentX GetTextAlignmentX () const =0
 Get the horizontal text alignment. More...
 
virtual Bool SetTextAlignmentY (IEnums::TextAlignmentY alignment)=0
 Set the vertical text alignment. More...
 
virtual IEnums::TextAlignmentY GetTextAlignmentY () const =0
 Get the vertical text alignment. More...
 
virtual Bool QueryTextSize (const String &text, Real &sizeX, Real &sizeY) const =0
 Query the dimensions of a given UTF8 text. More...
 

Detailed Description

The IText property interface.

This interface represents a generic way to describe an object used for text output.

Member Function Documentation

◆ GetFontResourceTarget() [1/2]

virtual IFontResourceTarget* Murl::Graph::IText::GetFontResourceTarget ( )
pure virtual

Get a mutable Graph::IFontResourceTarget container.

This method returns a mutable pointer to a Graph::IFontResourceTarget container, which allows to add, remove or query the font resources referenced by a node implementing this interface.

Returns
The mutable Graph::IFontResourceTarget container, or null if not available

◆ GetFontResourceTarget() [2/2]

virtual const IFontResourceTarget* Murl::Graph::IText::GetFontResourceTarget ( ) const
pure virtual

Get a constant Graph::IFontResourceTarget container.

This method returns a constant pointer to a Graph::IFontResourceTarget container, which allows to query the font resources referenced by a node implementing this interface.

Returns
The constant Graph::IFontResourceTarget container, or null if not available

◆ GetTextStyleNodeTarget() [1/2]

virtual ITextStyleNodeTarget* Murl::Graph::IText::GetTextStyleNodeTarget ( )
pure virtual

Get the optional mutable Graph::ITextStyleNodeTarget container.

This method returns a mutable pointer to a Graph::ITextStyleNodeTarget container, which allows to add, remove or query the text style node that is used to render the displayed text.

Returns
The mutable Graph::ITextStyleNodeTarget parent container, or null if not available

◆ GetTextStyleNodeTarget() [2/2]

virtual const ITextStyleNodeTarget* Murl::Graph::IText::GetTextStyleNodeTarget ( ) const
pure virtual

Get the optional constant Graph::ITextStyleNodeTarget container.

This method returns a constant pointer to a Graph::ITextStyleNodeTarget container, which allows to query the text style node that is used to render the displayed text.

Returns
The constant Graph::ITextNodeTarget parent container, or null if not available

◆ SetSystemFontName()

virtual Bool Murl::Graph::IText::SetSystemFontName ( const String fontName)
pure virtual

Set the ID of the system font used to render the text.

Parameters
fontNameA valid system font name, e.g. "SansBold".
Returns
true if successful.

◆ GetSystemFontName()

virtual const String& Murl::Graph::IText::GetSystemFontName ( ) const
pure virtual

Get the ID of the system font used to render the text.

Returns
The predefined system font ID.

◆ SetFontType()

virtual Bool Murl::Graph::IText::SetFontType ( IEnums::FontType  fontType)
pure virtual

Set the type of font used for rendering.

If not specified, the actual font type is retrieved from the given values for either system font name or the font resource. Once initialized, the node's font type cannot be changed anymore.

Parameters
fontTypeThe font type.
Returns
true if successful.

◆ GetFontType()

virtual IEnums::FontType Murl::Graph::IText::GetFontType ( ) const
pure virtual

Get the type of font used for rendering.

Returns
The font type.

◆ SetFontSize()

virtual Bool Murl::Graph::IText::SetFontSize ( Real  fontSize)
pure virtual

Set the font size.

Parameters
fontSizeThe font size in system units.
Returns
true if successful.

◆ GetFontSize()

virtual Real Murl::Graph::IText::GetFontSize ( ) const
pure virtual

Get the font size.

Returns
The font size in system units.

◆ SetTextColor()

virtual Bool Murl::Graph::IText::SetTextColor ( const Color textColor)
pure virtual

Set the foreground (text) color used for rendering the text.

Parameters
textColorThe text color.
Returns
true if successful.

◆ GetTextColor()

virtual const Color& Murl::Graph::IText::GetTextColor ( ) const
pure virtual

Get the text color.

Returns
The text color.

◆ SetBackgroundColor()

virtual Bool Murl::Graph::IText::SetBackgroundColor ( const Color backgroundColor)
pure virtual

Set the background color used for rendering.

Parameters
backgroundColorThe background color.
Returns
true if successful.

◆ GetBackgroundColor()

virtual const Color& Murl::Graph::IText::GetBackgroundColor ( ) const
pure virtual

Get the background color.

Returns
The background color.

◆ GetParentTextNodeTarget() [1/2]

virtual ITextNodeTarget* Murl::Graph::IText::GetParentTextNodeTarget ( )
pure virtual

Get the optional mutable Graph::ITextNodeTarget parent container.

This method returns a mutable pointer to a Graph::ITextNodeTarget container, which allows to add, remove or query the parent text node that is used as a source for the displayed text.

Returns
The mutable Graph::ITextNodeTarget parent container, or null if not available

◆ GetParentTextNodeTarget() [2/2]

virtual const ITextNodeTarget* Murl::Graph::IText::GetParentTextNodeTarget ( ) const
pure virtual

Get the optional constant Graph::ITextNodeTarget parent container.

This method returns a constant pointer to a Graph::ITextNodeTarget container, which allows to query the parent text node that is used as a source for the displayed text.

Returns
The constant Graph::ITextNodeTarget parent container, or null if not available

◆ GetOutputTextureNodeTarget() [1/2]

virtual ITextureNodeTarget* Murl::Graph::IText::GetOutputTextureNodeTarget ( )
pure virtual

Get the optional mutable output Graph::ITextureNodeTarget container.

This method returns a mutable pointer to a Graph::ITextureNodeTarget container, which allows to add, remove or query the texture node that is used as an optional output surface for the displayed text.

Returns
The mutable output Graph::ITextureNodeTarget container, or null if not available

◆ GetOutputTextureNodeTarget() [2/2]

virtual const ITextureNodeTarget* Murl::Graph::IText::GetOutputTextureNodeTarget ( ) const
pure virtual

Get the optional constant output Graph::ITextureNodeTarget container.

This method returns a constant pointer to a Graph::ITextureNodeTarget container, which allows to query the texture node that is used as an optional output surface for the displayed text.

Returns
The constant output Graph::ITextureNodeTarget container, or null if not available

◆ GetTextResourceTarget() [1/2]

virtual ITextResourceTarget* Murl::Graph::IText::GetTextResourceTarget ( )
pure virtual

Get a mutable Graph::ITextResourceTarget container.

This method returns a mutable pointer to a Graph::ITextResourceTarget container, which allows to add, remove or query the text resources referenced by a node implementing this interface.

Returns
The mutable Graph::ITextResourceTarget container, or null if not available

◆ GetTextResourceTarget() [2/2]

virtual const ITextResourceTarget* Murl::Graph::IText::GetTextResourceTarget ( ) const
pure virtual

Get a constant Graph::ITextResourceTarget container.

This method returns a constant pointer to a Graph::ITextResourceTarget container, which allows to query the text resources referenced by a node implementing this interface.

Returns
The constant Graph::ITextResourceTarget container, or null if not available

◆ SetText()

virtual Bool Murl::Graph::IText::SetText ( const String text)
pure virtual

Set the text to be displayed.

Parameters
textA string containing the text to be displayed.
Returns
true if successful.

◆ GetText()

virtual const String& Murl::Graph::IText::GetText ( ) const
pure virtual

Get the displayed text.

Returns
A constant reference to the string representing the displayed text.

◆ SetTextHintEnabled()

virtual Bool Murl::Graph::IText::SetTextHintEnabled ( IEnums::TextHint  hint,
Bool  enabled 
)
pure virtual

Enable/disable a given text hint.

Parameters
hintThe hint to enable or disable
enabledIf true, the given hint gets enabled.
Returns
true if successful.

◆ IsTextHintEnabled()

virtual Bool Murl::Graph::IText::IsTextHintEnabled ( IEnums::TextHint  hint) const
pure virtual

Check if a given trigger condition is enabled.

Parameters
hintThe hint to check.
Returns
true if enabled.

◆ SetSpacing()

virtual Bool Murl::Graph::IText::SetSpacing ( Real  spacing)
pure virtual

Set the character spacing value.

This method sets the character spacing used for output, i.e. the horizontal distance between neighbored characters. The given spacing value adds to the default value specified in the font used for rendering this text; a value of 0.0 represents the font's original spacing, a positive value increases the horizontal distance between characters, and a negative value decreases it.

Note: The given spacing value is not scaled by the font used; if e.g. a positive value is used for a large font, the same value used with a smaller version of that same font will result in a (relatively) larger distance between characters. It is however influenced by a possible additional scaling operation performed by a text rendering object.

Parameters
spacingThe character spacing value.
Returns
true if successful.

◆ GetSpacing()

virtual Real Murl::Graph::IText::GetSpacing ( ) const
pure virtual

Get the character spacing value.

Returns
The character spacing value.

◆ SetLeading()

virtual Bool Murl::Graph::IText::SetLeading ( Real  leading)
pure virtual

Set the leading value.

This method sets the leading value used for output, i.e. the vertical distance between subsequent text lines. The given leading value adds to the default value specified in the font used for rendering this text; a value of 0.0 represents the font's original leading, a positive value increases the vertical distance between lines, and a negative value decreases it.

Note: The given leading value is not scaled by the font used; if e.g. a positive value is used for a large font, the same value used with a smaller version of that same font will result in a (relatively) larger distance between lines. It is however influenced by a possible additional scaling operation performed by a text rendering object.

Parameters
leadingThe leading value.
Returns
true if successful.

◆ GetLeading()

virtual Real Murl::Graph::IText::GetLeading ( ) const
pure virtual

Get the leading value.

Returns
The leading value.

◆ SetEmbolding()

virtual Bool Murl::Graph::IText::SetEmbolding ( Real  strength)
pure virtual

Set the embolding strength value.

The embolding strength determines the "boldness" or "weight" of the font's rendered glyphs. Positive values result in thicker lines, and negative values can be used to make the font "thinner". Useful values are in the range from -1 to +1, but can also lie beyond that range.

Note that not all types of fonts allow glyph embolding. If not supported, this method returns false.

Parameters
strengthThe embolding strength value.
Returns
true if successful.

◆ GetEmbolding()

virtual Real Murl::Graph::IText::GetEmbolding ( ) const
pure virtual

Get the embolding strength value.

Returns
The embolding strength value.

◆ SetBlur()

virtual Bool Murl::Graph::IText::SetBlur ( Real  strength)
pure virtual

Set the blur strength value.

Parameters
strengthThe positive blur strength value.
Returns
true if successful.

◆ GetBlur()

virtual Real Murl::Graph::IText::GetBlur ( ) const
pure virtual

Get the blur strength value.

Returns
The blur strength value.

◆ SetSpaceWidthFactor()

virtual Bool Murl::Graph::IText::SetSpaceWidthFactor ( Real  factor)
pure virtual

Set the space width factor.

This method sets a factor used to control the actual width of the white space character. In some cases, it is useful to manually control the space character's width, when a font's default space width produces too small or too big a distance between subsequent words. A space width factor of 1.0 represents the original width defined by the font used for rendering.

Parameters
factorThe space width factor.
Returns
true if successful.

◆ GetSpaceWidthFactor()

virtual Real Murl::Graph::IText::GetSpaceWidthFactor ( ) const
pure virtual

Get the space width factor.

Returns
The space width factor.

◆ SetDigitWidthFactor()

virtual Bool Murl::Graph::IText::SetDigitWidthFactor ( Real  factor)
pure virtual

Set the digit width factor.

This method sets a factor used to control the horizontal advance of all digit characters of a font ('0'-'9'). A digit width factor of 1.0 represents the original width defined by the font used for rendering.

Note, that this value only influences distance and not visual width; a value of e.g. 0.1 will result in overlapping digits without actually scaling them.

Parameters
factorThe digit width factor.
Returns
true if successful.

◆ GetDigitWidthFactor()

virtual Real Murl::Graph::IText::GetDigitWidthFactor ( ) const
pure virtual

Get the digit width factor.

Returns
The digit width factor.

◆ SetSameDigitWidthEnabled()

virtual Bool Murl::Graph::IText::SetSameDigitWidthEnabled ( Bool  enabled)
pure virtual

Enable/disable unified digit width.

For certain use cases, such as a score counter in an action game, it is useful to set a common width for all digits ('0'-'9'); doing so prevents the counter from jittering due to different digit widths.

Parameters
enabledIf true, all digits use the same horizontal advance value.
Returns
true if successful.

◆ IsSameDigitWidthEnabled()

virtual Bool Murl::Graph::IText::IsSameDigitWidthEnabled ( ) const
pure virtual

Check if unified digit width is enabled.

Returns
true if all digits use the same horizontal advance value.

◆ SetWordWrappingEnabled()

virtual Bool Murl::Graph::IText::SetWordWrappingEnabled ( Bool  enabled)
pure virtual

Enable/disable word wrapping.

Parameters
enabledIf true, word wrapping is enabled.
Returns
true if successful.

◆ IsWordWrappingEnabled()

virtual Bool Murl::Graph::IText::IsWordWrappingEnabled ( ) const
pure virtual

Check if word wrapping is enabled.

Returns
true if word wrapping is enabled.

◆ SetTextAlignmentX()

virtual Bool Murl::Graph::IText::SetTextAlignmentX ( IEnums::TextAlignmentX  alignment)
pure virtual

Set the horizontal text alignment.

Parameters
alignmentThe horizontal text alignment.
Returns
true if successful.

◆ GetTextAlignmentX()

virtual IEnums::TextAlignmentX Murl::Graph::IText::GetTextAlignmentX ( ) const
pure virtual

Get the horizontal text alignment.

Returns
The horizontal text alignment.

◆ SetTextAlignmentY()

virtual Bool Murl::Graph::IText::SetTextAlignmentY ( IEnums::TextAlignmentY  alignment)
pure virtual

Set the vertical text alignment.

Parameters
alignmentThe vertical text alignment.
Returns
true if successful.

◆ GetTextAlignmentY()

virtual IEnums::TextAlignmentY Murl::Graph::IText::GetTextAlignmentY ( ) const
pure virtual

Get the vertical text alignment.

Returns
The vertical text alignment.

◆ QueryTextSize()

virtual Bool Murl::Graph::IText::QueryTextSize ( const String text,
Real sizeX,
Real sizeY 
) const
pure virtual

Query the dimensions of a given UTF8 text.

Parameters
textThe text to query
sizeXA reference to a Real variable receiving the horizontal text size.
sizeYA reference to a Real variable receiving the vertical text size.
Returns
true if successful.

The documentation for this interface was generated from the following file:
  • murl_graph_i_text.h


Copyright © 2011-2024 Spraylight GmbH.