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. | |
void | enableSnapCharacterToPixel (bool enable) |
Sets whether text rendering snaps character to pixel. | |
FontStyleDefinition ()=default | |
Constructor. | |
FontStyleDefinition (const FontStyleDefinition &origin)=default | |
Copy constructor. | |
float | getCharacterSpacing () const |
Gets the character spacing used with the font. | |
float | getFixedCharacterWidth () const |
Gets the fixed character width. | |
size_t | getHash () const |
Gets a hash value calculated from the current values of the font style definition. | |
FontHintingPreference | getHintingPreference () const |
Gets the hinting preference of the font. | |
float | getLineSpacing () const |
Gets the line spacing used with the font. | |
float | getSize () const |
Gets the size of the font in pixels. | |
FontStyle | getStyle () const |
Gets the style of the font. | |
FontWeight | getWeight () const |
Gets the weight of the font. | |
bool | isFractionalCharacterWidthEnabled () const |
Returns whether Kanzi uses fractional or rounded character widths to lay out text. | |
bool | isShapingEnabled () const |
Indicates whether bidirectional text and text shaping are enabled for the font. | |
bool | isSnapCharacterToPixelEnabled () const |
Returns whether text rendering snaps character to pixel. | |
bool | operator!= (const FontStyleDefinition &other) const |
Compares values with another FontStyleDefinition object. | |
FontStyleDefinition & | operator= (const FontStyleDefinition &origin)=default |
Assignment operation. | |
bool | operator== (const FontStyleDefinition &other) const |
Compares values with another FontStyleDefinition object. | |
void | setCharacterSpacing (float characterSpacing) |
Sets the character spacing in pixels. | |
void | setFixedCharacterWidth (float fixedCharacterWidth) |
Sets the fixed character width in pixels. | |
void | setHintingPreference (FontHintingPreference hintingPreference) |
Sets the hinting preference of the font. | |
void | setLineSpacing (float lineSpacing) |
Sets the line spacing. | |
void | setShapingEnabled (bool shapingEnabled) |
Sets support for complex scripts. | |
void | setSize (float size) |
Sets the size of the font in pixels. | |
void | setStyle (FontStyle style) |
Sets the style of the font. | |
void | setWeight (FontWeight weight) |
Sets the weight of the font. | |
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.
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.
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.
Sets the character spacing in pixels.
characterSpacing | Character spacing in pixels. |
float kanzi::FontStyleDefinition::getFixedCharacterWidth | ( | ) | const |
Gets the fixed character width.
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.
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.
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.
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.
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.