|
Krita Source Code Documentation
|
The FontStyleModel class. More...
#include <FontStyleModel.h>
Inheritance diagram for FontStyleModel:Classes | |
| struct | Private |
Public Member Functions | |
| Q_INVOKABLE QVariantHash | axesValues (int row) |
| int | columnCount (const QModelIndex &parent) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| FontStyleModel (QObject *parent=nullptr) | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| QModelIndex | parent (const QModelIndex &child) const |
| QHash< int, QByteArray > | roleNames () const override |
| int | rowCount (const QModelIndex &parent) const override |
| Q_INVOKABLE int | rowForStyle (const qreal &weight, const qreal &width, const int &styleMode, const qreal &styleValue) |
| Find the closest style that represents the current width, weight and stylemode. | |
| Q_INVOKABLE void | setFromTextPropertiesModel (KoSvgTextPropertiesModel *textPropertiesModel) |
| Update styles model from current text properties. | |
| void | setStylesInfo (QList< KoSvgText::FontFamilyStyleInfo > styles) |
| Set the base style info;. | |
| Q_INVOKABLE qreal | slantValue (int row) |
| Q_INVOKABLE int | styleModeValue (int row) |
| Q_INVOKABLE qreal | weightValue (int row) |
| Q_INVOKABLE qreal | widthValue (int row) |
| ~FontStyleModel () | |
Private Types | |
| enum | Roles { Weight = Qt::UserRole + 1 , Width , StyleMode , Slant , AxisValues } |
Private Attributes | |
| const QScopedPointer< Private > | d |
The FontStyleModel class.
This models the styles info present in KoFontFamily Resources.
Definition at line 19 of file FontStyleModel.h.
|
private |
| Enumerator | |
|---|---|
| Weight | qreal, represents 'wgth' |
| Width | qreal, represents 'wdth' |
| StyleMode | QFont::Style. |
| Slant | qreal, represents 'slnt' |
| AxisValues | other axis values |
Definition at line 22 of file FontStyleModel.h.
| FontStyleModel::FontStyleModel | ( | QObject * | parent = nullptr | ) |
Definition at line 25 of file FontStyleModel.cpp.
References d, and ResourceType::FontFamilies.
| FontStyleModel::~FontStyleModel | ( | ) |
Definition at line 37 of file FontStyleModel.cpp.
| QVariantHash FontStyleModel::axesValues | ( | int | row | ) |
Definition at line 89 of file FontStyleModel.cpp.
References AxisValues, data(), and index().
|
override |
Definition at line 225 of file FontStyleModel.cpp.
References parent().
|
override |
Definition at line 231 of file FontStyleModel.cpp.
References AxisValues, d, index(), KoSvgText::FontFamilyStyleInfo::instanceCoords, KoSvgText::FontFamilyStyleInfo::isItalic, KoSvgText::FontFamilyStyleInfo::isOblique, ITALIC_TAG, KoSvgText::FontFamilyStyleInfo::localizedLabels, Slant, SLANT_TAG, StyleMode, Weight, WEIGHT_TAG, Width, and WIDTH_TAG.
|
override |
Definition at line 205 of file FontStyleModel.cpp.
References parent().
| QModelIndex FontStyleModel::parent | ( | const QModelIndex & | child | ) | const |
Definition at line 213 of file FontStyleModel.cpp.
|
override |
Definition at line 275 of file FontStyleModel.cpp.
References AxisValues, Slant, StyleMode, Weight, and Width.
|
override |
| int FontStyleModel::rowForStyle | ( | const qreal & | weight, |
| const qreal & | width, | ||
| const int & | styleMode, | ||
| const qreal & | styleValue ) |
Find the closest style that represents the current width, weight and stylemode.
Definition at line 114 of file FontStyleModel.cpp.
References d, ITALIC_TAG, searchAxisTag(), SLANT_TAG, WEIGHT_TAG, and WIDTH_TAG.
| void FontStyleModel::setFromTextPropertiesModel | ( | KoSvgTextPropertiesModel * | textPropertiesModel | ) |
Update styles model from current text properties.
Definition at line 184 of file FontStyleModel.cpp.
References d, KoFontRegistry::instance(), setStylesInfo(), and KoFontRegistry::wwsNameByFamilyName().
| void FontStyleModel::setStylesInfo | ( | QList< KoSvgText::FontFamilyStyleInfo > | styles | ) |
Set the base style info;.
Definition at line 54 of file FontStyleModel.cpp.
References d, and styleLowerThan().
| qreal FontStyleModel::slantValue | ( | int | row | ) |
| int FontStyleModel::styleModeValue | ( | int | row | ) |
Definition at line 72 of file FontStyleModel.cpp.
References d, KoSvgText::FontFamilyStyleInfo::instanceCoords, KoSvgText::FontFamilyStyleInfo::isItalic, KoSvgText::FontFamilyStyleInfo::isOblique, ITALIC_TAG, and SLANT_TAG.
| qreal FontStyleModel::weightValue | ( | int | row | ) |
Definition at line 62 of file FontStyleModel.cpp.
References d, and WEIGHT_TAG.
| qreal FontStyleModel::widthValue | ( | int | row | ) |
|
private |
Definition at line 59 of file FontStyleModel.h.