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

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. More...
 
void initialize ()
 TextBlockConceptImpl -specific initialization. More...
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onPropertyChanged implementation. More...
 
virtual void onPostPrepareTextFormat (bool completeRelayoutingExecuted)
 Kanzi calls this function every time it completes the prepareTextFormat function. More...
 
 TextBlockConceptImpl (Domain *domain, string_view name)
 Constructor. More...
 
- Protected Member Functions inherited from kanzi::FontStyleConceptImpl< TDerivedClass >
 FontStyleConceptImpl ()=default
 Constructor. More...
 
- 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. More...
 
 TextConceptImpl ()=default
 Constructor. More...
 

Additional Inherited Members

- Static Public Attributes inherited from kanzi::TextBlockConcept
static PropertyType< bool > WordWrapProperty
 Breaks long text lines to multiple lines to make the text fit within the boundaries of a Text Block node. More...
 
- Static Public Attributes inherited from kanzi::FontStyleConcept
static PropertyType< float > SizeProperty
 Sets the size for the font in pixels. More...
 
static PropertyType< FontStyleStyleProperty
 Sets the style for the font. More...
 
static PropertyType< FontWeightWeightProperty
 Sets the weight for the font. More...
 
static PropertyType< float > CharacterSpacingProperty
 Sets the character spacing in pixels. More...
 
static PropertyType< float > FixedCharacterWidthProperty
 Overrides the font advance widths and makes each character take a fixed amount of space specified in pixels. More...
 
static PropertyType< float > LineSpacingProperty
 Sets the line spacing in multiples of the normal line height of the selected font. More...
 
static PropertyType< bool > FractionalCharacterWidthProperty
 Sets whether Kanzi uses fractional or rounded character widths to lay out text. More...
 
static PropertyType< bool > SnapCharacterToPixelProperty
 Sets whether Kanzi positions characters in 2D rendering to the nearest pixel: More...
 
static PropertyType< FontHintingPreferenceHintingPreferenceProperty
 Sets the hinting preference of the selected font. More...
 
- 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. More...
 
static PropertyType< ResourceSharedPtrFontMaterialProperty
 Sets the material whose shader is used to render the text in a text node. More...
 
static PropertyType< Vector2HorizontalPaddingProperty
 Sets the padding spaces between the content and the left and right boundaries of a text node. More...
 
static PropertyType< bool > RemoveSideBearingsProperty
 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. More...
 
static PropertyType< string > TextProperty
 Sets the text content that a text node renders. More...
 
static PropertyType< TextFormat::TextHorizontalAlignmentTextHorizontalAlignmentProperty
 Sets the horizontal alignment of the text in a text node. More...
 
static PropertyType< TextFormat::TextVerticalAlignmentTextVerticalAlignmentProperty
 Sets the vertical alignment of the text in a text node. More...
 
static PropertyType< Vector2VerticalPaddingProperty
 Sets the padding spaces between the content and the top and bottom boundaries of a text node. More...
 
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. More...
 
static PropertyType< bool > HorizontalFitProperty
 Allows a Text Block to scale glyphs horizontally when the text string is too long to fit in that Text Block. More...
 
static PropertyType< Vector2HorizontalFitScaleLimitsProperty
 Sets the scale range that the HorizontalFitProperty can use when it scales the text horizontally. More...
 
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. More...
 
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. More...
 
- Protected Attributes inherited from kanzi::TextConceptImpl< TDerivedClass >
TextFormatPtr m_textFormat
 The text format for the text that this node displays. More...
 

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

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

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static
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()
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()
template<typename TBaseClass , typename TDerivedClass >
RectangleFloat kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::getTextBounds ( ) const

Get bounding rectangle for the text.

Returns
Rectangle.
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
template<typename TBaseClass , typename TDerivedClass >
void kanzi::TextBlockConceptImpl< TBaseClass, TDerivedClass >::initialize ( )
protected

TextBlockConceptImpl -specific initialization.

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

Node::onPropertyChanged implementation.

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
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: