Kanzi 3.9.10
kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

Implementation class for TextBlockConcept. More...

#include <kanzi/ui/node/concept/text_block.hpp>

Inheritance diagram for kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >:
[legend]

Public Member Functions

RectangleFloat getTextBounds () const
 Get bounding rectangle for the text.
 
bool getWordWrap () const
 Gets the value of WordWrapProperty.
 
void notifyPostPrepareTextFormat (bool completeRelayoutingExecuted)
 Kanzi calls this function every time it successfully completes the TextConceptImpl::prepareTextFormat() function.
 
void setWordWrap (bool value)
 Sets the value of WordWrapProperty.
 
- Public Member Functions inherited from kanzi::FontStyleConceptImpl< TDerivedClass >
float getCharacterSpacing () const
 Gets the value of the FontStyleConcept::CharacterSpacingProperty property.
 
float getFixedCharacterWidth () const
 Gets the value of the FontStyleConcept::FixedCharacterWidthProperty property.
 
float getFontSize () const
 Gets the value of the FontStyleConcept::SizeProperty property.
 
FontStyle getFontStyle () const
 Gets the value of the FontStyleConcept::StyleProperty property.
 
FontWeight getFontWeight () const
 Gets the value of the FontStyleConcept::WeightProperty property.
 
bool getFractionalCharacterWidth () const
 Gets the value of the FontStyleConcept::FractionalCharacterWidthProperty property.
 
FontHintingPreference getHintingPreference () const
 Gets the value of HintingPreferenceProperty.
 
float getLineSpacing () const
 Gets the value of the FontStyleConcept::LineSpacingProperty property.
 
FontRuntimeSharedPtr getRuntimeFont ()
 Gets the runtime font.
 
bool getSnapCharacterToPixel () const
 Gets the value of the FontStyleConcept::SnapCharacterToPixelProperty property.
 
void releaseRuntimeFont ()
 Releases the runtime font that is held by FontStyleConceptImpl.
 
void setCharacterSpacing (float value)
 Sets the value of the FontStyleConcept::CharacterSpacingProperty property.
 
void setFixedCharacterWidth (float value)
 Sets the value of the FontStyleConcept::FixedCharacterWidthProperty property.
 
void setFontSize (float value)
 Sets the value of the FontStyleConcept::SizeProperty property.
 
void setFontStyle (FontStyle style)
 Sets the value of the FontStyleConcept::StyleProperty property.
 
void setFontWeight (FontWeight weight)
 Sets the value of the FontStyleConcept::WeightProperty property.
 
void setFractionalCharacterWidth (bool enable)
 Sets the value of the FontStyleConcept::FractionalCharacterWidthProperty property.
 
void setHintingPreference (FontHintingPreference hintingPreference)
 Sets the value of HintingPreferenceProperty.
 
void setLineSpacing (float value)
 Sets the value of the FontStyleConcept::LineSpacingProperty property.
 
void setSnapCharacterToPixel (bool enable)
 Sets the value of the FontStyleConcept::SnapCharacterToPixelProperty property.
 
bool updateRuntimeFont ()
 Updates the runtime font.
 
- Public Member Functions inherited from kanzi::TextConceptImpl< TDerivedClass >
ColorRGBA getFontColor () const
 Gets the value of the FontColorProperty.
 
MaterialSharedPtr getFontMaterial () const
 Gets the value of the FontMaterialProperty.
 
bool getHorizontalFit () const
 Gets the value of the HorizontalFitProperty.
 
Vector2 getHorizontalFitScaleLimits () const
 Gets the value of the HorizontalFitScaleLimitsProperty.
 
Vector2 getHorizontalPadding () const
 Gets the value of HorizontalPaddingProperty.
 
string getOverflow () const
 Gets the value of the OverflowProperty.
 
bool getRemoveSideBearings () const
 Gets the value of the RemoveSideBearingsProperty.
 
string getText () const
 Gets the value of TextProperty.
 
TextFormat::TextHorizontalAlignment getTextHorizontalAlignment () const
 Gets the value of the TextHorizontalAlignmentProperty.
 
TextFormat::TextVerticalAlignment getTextVerticalAlignment () const
 Gets the value of the TextVerticalAlignmentProperty.
 
TextFormat::Truncation getTruncation () const
 Gets the value of the TruncationProperty.
 
TextFormat::TruncationDirection getTruncationDirection () const
 Gets the value of the TruncationDirectionProperty.
 
Vector2 getVerticalPadding () const
 Gets the value of VerticalPaddingProperty.
 
void setFontColor (ColorRGBA value)
 Sets the value of the FontColorProperty.
 
void setFontMaterial (MaterialSharedPtr value)
 Sets the value of the FontMaterialProperty.
 
void setHorizontalFit (bool value)
 Sets the value of the HorizontalFitProperty.
 
void setHorizontalFitScaleLimits (Vector2 value)
 Sets the value of the HorizontalFitScaleLimitsProperty.
 
void setHorizontalPadding (Vector2 value)
 Sets the value of HorizontalPaddingProperty.
 
void setOverflow (string_view value)
 Sets the value of the OverflowProperty.
 
void setRemoveSideBearings (bool value)
 Sets the value of the RemoveSideBearingsProperty.
 
void setText (string value)
 Sets the value of TextProperty.
 
void setTextHorizontalAlignment (TextFormat::TextHorizontalAlignment value)
 Sets the value of the TextHorizontalAlignmentProperty.
 
void setTextVerticalAlignment (TextFormat::TextVerticalAlignment value)
 Sets the value of the TextVerticalAlignmentProperty.
 
void setTruncation (TextFormat::Truncation value)
 Sets the value of the TruncationProperty.
 
void setTruncationDirection (TextFormat::TruncationDirection value)
 Sets the value of the TruncationDirectionProperty.
 
void setVerticalPadding (Vector2 value)
 Sets the value of VerticalPaddingProperty.
 
virtual ~TextConceptImpl ()=default
 Destructor.
 
- Public Member Functions inherited from kanzi::TextConcept
virtual ~TextConcept ()=default
 Destructor.
 

Static Public Member Functions

static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::TextBlockConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::FontStyleConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::TextConceptImpl< TDerivedClass >
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::TextConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Protected Member Functions

TextConcept::TextFormatParameters createTextFormatParameters (float width, float height) const
 Creates the parameters that are needed for initializing the TextFormat of a TextBlock node.
 
void initialize ()
 TextBlockConceptImpl -specific initialization.
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onPropertyChanged implementation.
 
virtual void onPostPrepareTextFormat (bool completeRelayoutingExecuted)
 Kanzi calls this function every time it completes the prepareTextFormat function.
 
 TextBlockConceptImpl (Domain *domain, string_view name)
 Constructor.
 
- Protected Member Functions inherited from kanzi::FontStyleConceptImpl< TDerivedClass >
 FontStyleConceptImpl ()=default
 Constructor.
 
- Protected Member Functions inherited from kanzi::TextConceptImpl< TDerivedClass >
void prepareTextFormat (const TextFormatParameters &parameters, string text)
 Updates the parameters and text of the internal text format.
 
 TextConceptImpl ()=default
 Constructor.
 

Additional Inherited Members

- Static Public Attributes inherited from kanzi::TextBlockConcept
static PropertyType< boolWordWrapProperty
 Breaks long text lines to multiple lines to make the text fit within the boundaries of a Text Block node.
 
- Static Public Attributes inherited from kanzi::FontStyleConcept
static PropertyType< floatSizeProperty
 Sets the size for the font in pixels.
 
static PropertyType< FontStyleStyleProperty
 Sets the style for the font.
 
static PropertyType< FontWeightWeightProperty
 Sets the weight for the font.
 
static PropertyType< floatCharacterSpacingProperty
 Sets the character spacing in pixels.
 
static PropertyType< floatFixedCharacterWidthProperty
 Overrides the font advance widths and makes each character take a fixed amount of space specified in pixels.
 
static PropertyType< floatLineSpacingProperty
 Sets the line spacing in multiples of the normal line height of the selected font.
 
static PropertyType< boolFractionalCharacterWidthProperty
 Sets whether Kanzi uses fractional or rounded character widths to lay out text.
 
static PropertyType< boolSnapCharacterToPixelProperty
 Sets whether Kanzi positions characters in 2D rendering to the nearest pixel:
 
static PropertyType< FontHintingPreferenceHintingPreferenceProperty
 Sets the hinting preference of the selected font.
 
- Static Public Attributes inherited from kanzi::TextConcept
static PropertyType< ColorRGBAFontColorProperty
 Sets the text color for the default font material and for the materials with a fragment shader that uses the FontColor uniform.
 
static PropertyType< ResourceSharedPtrFontMaterialProperty
 Sets the material whose shader is used to render the text in a 3D text node.
 
static PropertyType< string > TextProperty
 Sets the text content that a text node renders.
 
static PropertyType< TextFormat::TextHorizontalAlignmentTextHorizontalAlignmentProperty
 Sets the horizontal alignment of the text in a text node.
 
static PropertyType< TextFormat::TextVerticalAlignmentTextVerticalAlignmentProperty
 Sets the vertical alignment of the text in a text node.
 
static PropertyType< Vector2HorizontalPaddingProperty
 Sets the padding spaces between the content and the left and right boundaries of a text node.
 
static PropertyType< Vector2VerticalPaddingProperty
 Sets the padding spaces between the content and the top and bottom boundaries of a text node.
 
static PropertyType< string > OverflowProperty
 Sets the characters that represent the truncated text when the text string to be rendered is too long to fit in a text node.
 
static PropertyType< TextFormat::TruncationTruncationProperty
 Sets how to truncate the text when the text string to be rendered is too long to fit in a node.
 
static PropertyType< TextFormat::TruncationDirectionTruncationDirectionProperty
 Sets which part of the text to truncate when the text string to be rendered is too long to fit in a node.
 
static PropertyType< boolRemoveSideBearingsProperty
 Sets the position of the leftmost characters of left-aligned text and rightmost characters of right-aligned text exactly within the boundary of the text node.
 
static PropertyType< boolHorizontalFitProperty
 Allows a Text Block to scale glyphs horizontally when the text string is too long to fit in that Text Block.
 
static PropertyType< Vector2HorizontalFitScaleLimitsProperty
 Sets the scale range that the HorizontalFitProperty can use when it scales the text horizontally.
 
- Protected Attributes inherited from kanzi::TextConceptImpl< TDerivedClass >
TextFormatPtr m_textFormat
 The text format for the text that this node displays.
 

Detailed Description

template<typename TBaseClass, typename TDerivedClass>
class kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >

Implementation class for TextBlockConcept.

Use the Text Block nodes to show a small amount of text in your application.

TextBlockConceptImpl derives from TextBlockConcept class, which defines the property types used by the implementation. Do not use these classes directly. To show a block of text in your application use TextBlock2D or TextBlock3D.

Constructor & Destructor Documentation

◆ TextBlockConceptImpl()

template<typename TBaseClass , typename TDerivedClass >
kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::TextBlockConceptImpl ( Domain * domain,
string_view name )
explicitprotected

Constructor.

Parameters
domainThe UI domain the new node belongs to.
nameThe name of the node.

Member Function Documentation

◆ makeEditorInfo()

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static

◆ getWordWrap()

template<typename TBaseClass , typename TDerivedClass >
bool kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getWordWrap ( ) const

Gets the value of WordWrapProperty.

Returns
Whether to wrap into a new line the text that is longer than the width of the Text Block node.
See also
setWordWrap()

◆ setWordWrap()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::setWordWrap ( bool value)

Sets the value of WordWrapProperty.

Parameters
valueWhether to wrap into a new line the text that is longer than the width of the Text Block node.
See also
getWordWrap()

◆ getTextBounds()

template<typename TBaseClass , typename TDerivedClass >
RectangleFloat kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextBounds ( ) const

Get bounding rectangle for the text.

Returns
Rectangle.

◆ notifyPostPrepareTextFormat()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::notifyPostPrepareTextFormat ( bool completeRelayoutingExecuted)

Kanzi calls this function every time it successfully completes the TextConceptImpl::prepareTextFormat() function.

Parameters
completeRelayoutingExecutedIndicates whether a complete relayouting of the glyphs was required while preparing the text format.
Since
Kanzi 3.8.0

◆ initialize()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::initialize ( )
protected

TextBlockConceptImpl -specific initialization.

◆ onNodePropertyChanged()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType propertyType,
PropertyNotificationReason reason )
overrideprotected

Node::onPropertyChanged implementation.

◆ onPostPrepareTextFormat()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::onPostPrepareTextFormat ( bool completeRelayoutingExecuted)
protectedvirtual

Kanzi calls this function every time it completes the prepareTextFormat function.

Parameters
completeRelayoutingExecutedIndicates whether a complete relayouting of the glyphs was required during the text format preparation.
Since
Kanzi 3.8.0

◆ createTextFormatParameters()

template<typename TBaseClass , typename TDerivedClass >
TextConcept::TextFormatParameters kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::createTextFormatParameters ( float width,
float height ) const
protected

Creates the parameters that are needed for initializing the TextFormat of a TextBlock node.

Parameters
widthThe available width.
heightThe available height.
Returns
TextFormatParameters suitable for initializing the TextFormat of a TextBlock node.
See also
TextConcept::TextFormatParameters
Since
Kanzi 3.9.0

The documentation for this class was generated from the following files: