FontStyleDefinition provides a collection of font characteristics. More...
#include <kanzi/core.ui/font/font_style_definition.hpp>
Public Member Functions | |
void | enableFractionalCharacterWidth (bool enable) |
Sets whether Kanzi uses fractional or rounded character widths to lay out text. More... | |
void | enableSnapCharacterToPixel (bool enable) |
Sets whether text rendering snaps character to pixel. More... | |
FontStyleDefinition ()=default | |
Constructor. More... | |
FontStyleDefinition (const FontStyleDefinition &origin)=default | |
Copy constructor. More... | |
float | getCharacterSpacing () const |
Gets the character spacing used with the font. More... | |
float | getFixedCharacterWidth () const |
Gets the fixed character width. More... | |
size_t | getHash () const |
Gets a hash value calculated from the current values of the font style definition. More... | |
FontHintingPreference | getHintingPreference () const |
Gets the hinting preference of the font. More... | |
float | getLineSpacing () const |
Gets the line spacing used with the font. More... | |
float | getSize () const |
Gets the size of the font in pixels. More... | |
FontStyle | getStyle () const |
Gets the style of the font. More... | |
FontWeight | getWeight () const |
Gets the weight of the font. More... | |
bool | isFractionalCharacterWidthEnabled () const |
Returns whether Kanzi uses fractional or rounded character widths to lay out text. More... | |
bool | isShapingEnabled () const |
Indicates whether bidirectional text and text shaping are enabled for the font. More... | |
bool | isSnapCharacterToPixelEnabled () const |
Returns whether text rendering snaps character to pixel. More... | |
bool | operator!= (const FontStyleDefinition &other) const |
Compares values with another FontStyleDefinition object. More... | |
FontStyleDefinition & | operator= (const FontStyleDefinition &origin)=default |
Assignment operation. More... | |
bool | operator== (const FontStyleDefinition &other) const |
Compares values with another FontStyleDefinition object. More... | |
void | setCharacterSpacing (float characterSpacing) |
Sets the character spacing in pixels. More... | |
void | setFixedCharacterWidth (float fixedCharacterWidth) |
Sets the fixed character width in pixels. More... | |
void | setHintingPreference (FontHintingPreference hintingPreference) |
Sets the hinting preference of the font. More... | |
void | setLineSpacing (float lineSpacing) |
Sets the line spacing. More... | |
void | setShapingEnabled (bool shapingEnabled) |
Sets support for complex scripts. More... | |
void | setSize (float size) |
Sets the size of the font in pixels. More... | |
void | setStyle (FontStyle style) |
Sets the style of the font. More... | |
void | setWeight (FontWeight weight) |
Sets the weight of the font. More... | |
FontStyleDefinition provides a collection of font characteristics.
|
explicitdefault |
Constructor.
|
default |
Copy constructor.
|
default |
Assignment operation.
bool kanzi::FontStyleDefinition::operator== | ( | const FontStyleDefinition & | other | ) | const |
Compares values with another FontStyleDefinition object.
bool kanzi::FontStyleDefinition::operator!= | ( | const FontStyleDefinition & | other | ) | const |
Compares values with another FontStyleDefinition object.
float kanzi::FontStyleDefinition::getSize | ( | ) | const |
Gets the size of the font in pixels.
void kanzi::FontStyleDefinition::setSize | ( | float | size | ) |
Sets the size of the font in pixels.
size | Size of the font in pixels. |
FontStyle kanzi::FontStyleDefinition::getStyle | ( | ) | const |
Gets the style of the font.
void kanzi::FontStyleDefinition::setStyle | ( | FontStyle | style | ) |
Sets the style of the font.
style | Style of the font. |
FontWeight kanzi::FontStyleDefinition::getWeight | ( | ) | const |
Gets the weight of the font.
void kanzi::FontStyleDefinition::setWeight | ( | FontWeight | weight | ) |
Sets the weight of the font.
weight | Weight of the font. |
float kanzi::FontStyleDefinition::getCharacterSpacing | ( | ) | const |
Gets the character spacing used with the font.
Character spacing is additional spacing in pixels that is added between each character.
void kanzi::FontStyleDefinition::setCharacterSpacing | ( | float | characterSpacing | ) |
Sets the character spacing in pixels.
characterSpacing | Character spacing in pixels. |
float kanzi::FontStyleDefinition::getFixedCharacterWidth | ( | ) | const |
Gets the fixed character width.
void kanzi::FontStyleDefinition::setFixedCharacterWidth | ( | float | fixedCharacterWidth | ) |
Sets the fixed character width in pixels.
To disable fixed character width, use a negative value.
fixedCharacterWidth | Fixed width of character to use. |
bool kanzi::FontStyleDefinition::isShapingEnabled | ( | ) | const |
Indicates whether bidirectional text and text shaping are enabled for the font.
When disabled, basic layouting is used.
void kanzi::FontStyleDefinition::setShapingEnabled | ( | bool | shapingEnabled | ) |
Sets support for complex scripts.
This includes support for bidirectional text, and languages that require ligatures or glyph substitution.
shapingEnabled | True to enable shaping. |
float kanzi::FontStyleDefinition::getLineSpacing | ( | ) | const |
Gets the line spacing used with the font.
Returned line spacing is in multiples of line height.
void kanzi::FontStyleDefinition::setLineSpacing | ( | float | lineSpacing | ) |
Sets the line spacing.
The value is relative to the font height. For example, 1 is normal spacing and 2 is double spacing.
lineSpacing | Line spacing to use. |
bool kanzi::FontStyleDefinition::isFractionalCharacterWidthEnabled | ( | ) | const |
Returns whether Kanzi uses fractional or rounded character widths to lay out text.
void kanzi::FontStyleDefinition::enableFractionalCharacterWidth | ( | bool | enable | ) |
Sets whether Kanzi uses fractional or rounded character widths to lay out text.
enable | To use fractional character widths, set to true. To use rounded character widths, set to false. |
bool kanzi::FontStyleDefinition::isSnapCharacterToPixelEnabled | ( | ) | const |
Returns whether text rendering snaps character to pixel.
void kanzi::FontStyleDefinition::enableSnapCharacterToPixel | ( | bool | enable | ) |
Sets whether text rendering snaps character to pixel.
enable | To snap character to pixel, set to true. |
void kanzi::FontStyleDefinition::setHintingPreference | ( | FontHintingPreference | hintingPreference | ) |
Sets the hinting preference of the font.
hintingPreference | The hinting preference of the font. |
FontHintingPreference kanzi::FontStyleDefinition::getHintingPreference | ( | ) | const |
Gets the hinting preference of the font.
size_t kanzi::FontStyleDefinition::getHash | ( | ) | const |
Gets a hash value calculated from the current values of the font style definition.