Kanzi  3.9.6
Kanzi Engine API
kanzi::FontStyleConceptImpl< TDerivedClass > Class Template Reference

Implementation class for FontStyleConcept. More...

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

Inheritance diagram for kanzi::FontStyleConceptImpl< TDerivedClass >:
[legend]

Public Member Functions

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

Protected Member Functions

 FontStyleConceptImpl ()=default
 Constructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from kanzi::FontStyleConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- 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...
 

Detailed Description

template<typename TDerivedClass>
class kanzi::FontStyleConceptImpl< TDerivedClass >

Implementation class for FontStyleConcept.

Since
Kanzi 3.8.0

Constructor & Destructor Documentation

◆ FontStyleConceptImpl()

template<typename TDerivedClass>
kanzi::FontStyleConceptImpl< TDerivedClass >::FontStyleConceptImpl ( )
explicitprotecteddefault

Constructor.

Member Function Documentation

◆ updateRuntimeFont()

template<typename TDerivedClass >
bool kanzi::FontStyleConceptImpl< TDerivedClass >::updateRuntimeFont ( )

Updates the runtime font.

If FontStyleConceptImpl does not yet have a runtime font, fetches a new runtime font. In case runtime font does not match with the node properties, which determine the font characteristics, fetches a new runtime font.

Returns
If a new runtime font is fetched, true, otherwise false.

◆ getRuntimeFont()

template<typename TDerivedClass >
FontRuntimeSharedPtr kanzi::FontStyleConceptImpl< TDerivedClass >::getRuntimeFont ( )

Gets the runtime font.

If FontStyleConceptImpl does not yet have a runtime font, fetches a new runtime font.

Returns
Pointer to the runtime font.

◆ releaseRuntimeFont()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::releaseRuntimeFont ( )

Releases the runtime font that is held by FontStyleConceptImpl.

◆ getFontSize()

template<typename TDerivedClass >
float kanzi::FontStyleConceptImpl< TDerivedClass >::getFontSize ( ) const

Gets the value of the FontStyleConcept::SizeProperty property.

Returns
The size of the font in pixels.
See also
setFontSize()

◆ setFontSize()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setFontSize ( float  value)

Sets the value of the FontStyleConcept::SizeProperty property.

Parameters
valueThe size of the font in pixels.
See also
getFontSize()

◆ getFontStyle()

template<typename TDerivedClass >
FontStyle kanzi::FontStyleConceptImpl< TDerivedClass >::getFontStyle ( ) const

Gets the value of the FontStyleConcept::StyleProperty property.

Returns
The requested style for the font file that Kanzi fetches from the selected font family.
See also
setFontStyle()

◆ setFontStyle()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setFontStyle ( FontStyle  style)

Sets the value of the FontStyleConcept::StyleProperty property.

Parameters
styleThe requested style for the font file that Kanzi fetches from the selected font family.
See also
getFontStyle()

◆ getFontWeight()

template<typename TDerivedClass >
FontWeight kanzi::FontStyleConceptImpl< TDerivedClass >::getFontWeight ( ) const

Gets the value of the FontStyleConcept::WeightProperty property.

Returns
The requested weight for the font file that Kanzi fetches from the selected font family.
See also
setFontWeight()

◆ setFontWeight()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setFontWeight ( FontWeight  weight)

Sets the value of the FontStyleConcept::WeightProperty property.

Parameters
weightThe requested weight for the font file that Kanzi fetches from the selected font family.
See also
getFontWeight()

◆ getLineSpacing()

template<typename TDerivedClass >
float kanzi::FontStyleConceptImpl< TDerivedClass >::getLineSpacing ( ) const

Gets the value of the FontStyleConcept::LineSpacingProperty property.

Returns
The line spacing in multiples of the normal line height of the selected font.
See also
setLineSpacing()

◆ setLineSpacing()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setLineSpacing ( float  value)

Sets the value of the FontStyleConcept::LineSpacingProperty property.

Parameters
valueThe line spacing in multiples of the normal line height of the selected font.
See also
getLineSpacing()

◆ getCharacterSpacing()

template<typename TDerivedClass >
float kanzi::FontStyleConceptImpl< TDerivedClass >::getCharacterSpacing ( ) const

Gets the value of the FontStyleConcept::CharacterSpacingProperty property.

Returns
The character spacing in pixels.
See also
setCharacterSpacing()

◆ setCharacterSpacing()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setCharacterSpacing ( float  value)

Sets the value of the FontStyleConcept::CharacterSpacingProperty property.

Parameters
valueThe character spacing in pixels.
See also
getCharacterSpacing()

◆ getFixedCharacterWidth()

template<typename TDerivedClass >
float kanzi::FontStyleConceptImpl< TDerivedClass >::getFixedCharacterWidth ( ) const

Gets the value of the FontStyleConcept::FixedCharacterWidthProperty property.

Returns
The fixed character width in pixels.
See also
setFixedCharacterWidth()

◆ setFixedCharacterWidth()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setFixedCharacterWidth ( float  value)

Sets the value of the FontStyleConcept::FixedCharacterWidthProperty property.

Parameters
valueThe fixed character width in pixels.
See also
getFixedCharacterWidth()

◆ getFractionalCharacterWidth()

template<typename TDerivedClass >
bool kanzi::FontStyleConceptImpl< TDerivedClass >::getFractionalCharacterWidth ( ) const

Gets the value of the FontStyleConcept::FractionalCharacterWidthProperty property.

Returns
If fractional character width is enabled, true, otherwise false.
See also
setFractionalCharacterWidth()
Since
Kanzi 3.9.0

◆ setFractionalCharacterWidth()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setFractionalCharacterWidth ( bool  enable)

Sets the value of the FontStyleConcept::FractionalCharacterWidthProperty property.

Parameters
enableTo enable fractional character width, set to true.
See also
getFractionalCharacterWidth()
Since
Kanzi 3.9.0

◆ getSnapCharacterToPixel()

template<typename TDerivedClass >
bool kanzi::FontStyleConceptImpl< TDerivedClass >::getSnapCharacterToPixel ( ) const

Gets the value of the FontStyleConcept::SnapCharacterToPixelProperty property.

Returns
If snap character to pixel is enabled, true, otherwise false.
See also
setSnapCharacterToPixel()
Since
Kanzi 3.9.0

◆ setSnapCharacterToPixel()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setSnapCharacterToPixel ( bool  enable)

Sets the value of the FontStyleConcept::SnapCharacterToPixelProperty property.

Parameters
enableTo enable snap character to pixel, set to true.
See also
getSnapCharacterToPixel()
Since
Kanzi 3.9.0

◆ getHintingPreference()

template<typename TDerivedClass >
FontHintingPreference kanzi::FontStyleConceptImpl< TDerivedClass >::getHintingPreference ( ) const

Gets the value of HintingPreferenceProperty.

See also
setHintingPreference()
Since
Kanzi 3.9.0

◆ setHintingPreference()

template<typename TDerivedClass >
void kanzi::FontStyleConceptImpl< TDerivedClass >::setHintingPreference ( FontHintingPreference  hintingPreference)

Sets the value of HintingPreferenceProperty.

Parameters
hintingPreferenceThe hinting preference of the font.
See also
getHintingPreference()
Since
Kanzi 3.9.0

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