Kanzi  3.9.7
Kanzi Engine API
kanzi::FontStyleConcept Class Reference

FontStyleConcept is the base class for the nodes that draw text with different font styles. More...

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

Inheritance diagram for kanzi::FontStyleConcept:
[legend]

Static Public Member Functions

static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Static Public Attributes

Properties

Used by text block nodes for font styling.

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

FontStyleConcept is the base class for the nodes that draw text with different font styles.

Since
Kanzi 3.8.0

Member Function Documentation

static PropertyTypeEditorInfoSharedPtr kanzi::FontStyleConcept::makeEditorInfo ( )
static

Member Data Documentation

PropertyType<float> kanzi::FontStyleConcept::SizeProperty
static

Sets the size for the font in pixels.

The default value is 36.0f.

PropertyType<FontStyle> kanzi::FontStyleConcept::StyleProperty
static

Sets the style for the font.

The default value is FontStyle::Normal.

PropertyType<FontWeight> kanzi::FontStyleConcept::WeightProperty
static

Sets the weight for the font.

The default value is FontWeight::Normal.

PropertyType<float> kanzi::FontStyleConcept::CharacterSpacingProperty
static

Sets the character spacing in pixels.

The default value is 0.0f.

PropertyType<float> kanzi::FontStyleConcept::FixedCharacterWidthProperty
static

Overrides the font advance widths and makes each character take a fixed amount of space specified in pixels.

The default value is -1.0f.

PropertyType<float> kanzi::FontStyleConcept::LineSpacingProperty
static

Sets the line spacing in multiples of the normal line height of the selected font.

The default value is 1.0f.

PropertyType<bool> kanzi::FontStyleConcept::FractionalCharacterWidthProperty
static

Sets whether Kanzi uses fractional or rounded character widths to lay out text.

In most cases fractional widths provide the best result. However, with small font sizes, fractional widths can cause the characters to run together or have too much space, making it difficult to read.

  • When enabled, Kanzi uses fractional character widths, which means that the spacing between characters varies and can be a fraction of a pixel.
  • When disabled, Kanzi uses character widths rounded to the nearest pixel. Disable fractional widths when you want to fix character spacing in whole-pixel increments and prevent characters in small font sizes from running together. The default value is true.
    Since
    Kanzi 3.9.0
PropertyType<bool> kanzi::FontStyleConcept::SnapCharacterToPixelProperty
static

Sets whether Kanzi positions characters in 2D rendering to the nearest pixel:

  • When enabled, text sharpness improves, but some characters can shift a fraction of a pixel.
  • When disabled, certain combinations of screen resolution, use of anti-aliasing, and font size can cause the text to appear blurry. In that case, you can improve the appearance of the text with the FractionalCharacterWidthProperty and CharacterSpacingProperty properties. The default value is true.
    Since
    Kanzi 3.9.0
PropertyType<FontHintingPreference> kanzi::FontStyleConcept::HintingPreferenceProperty
static

Sets the hinting preference of the selected font.

The default value is FontHintingPreference::NativeHinting.

See also
FontStyleConceptImpl::setHintingPreference(), FontStyleConceptImpl::getHintingPreference()
Since
Kanzi 3.9.0

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