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

Protected Member Functions

 FontStyleConceptImpl ()=default
 Constructor.
 

Additional Inherited Members

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

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()

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()

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()

Gets the value of the FontStyleConcept::SizeProperty property.

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

◆ setFontSize()

Sets the value of the FontStyleConcept::SizeProperty property.

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

◆ getFontStyle()

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()

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()

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()

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()

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()

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: