13#include <KLocalizedString>
26 setMinimumSize(500, 300);
30 m_quickWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
32 this->setWindowTitle(i18nc(
"@title:window",
"Glyph Palette"));
43 qWarning() <<
"Errors in " << windowTitle() <<
":" <<
m_quickWidget->errors();
59 if (text.isEmpty())
return;
62 m_quickWidget->rootObject()->setProperty(
"currentIndex", QVariant::fromValue(idx.row()));
67 const qreal res = 72.0;
74 static_cast<quint32
>(res),
75 static_cast<quint32
>(res));
78 if (faces.empty())
return;
79 m_model->
setFace(faces.front(), QLatin1String(language.toLatin1()));
86 m_quickWidget->rootObject()->setProperty(
"fontSize", QVariant::fromValue(info.
size));
88 m_quickWidget->rootObject()->setProperty(
"fontWidth", QVariant::fromValue(info.
width));
90 m_quickWidget->rootObject()->setProperty(
"fontAxesValues", QVariant::fromValue(map));
91 m_quickWidget->rootObject()->setProperty(
"language", QVariant::fromValue(language));
93 m_quickWidget->rootObject()->setProperty(
"currentIndex", QVariant::fromValue(idx.row()));
105 QAbstractItemModel *model = useCharMap? qobject_cast<QAbstractItemModel*>(
m_charMapModel): qobject_cast<QAbstractItemModel*>(
m_model);
106 QModelIndex idx = model->index(charRow, 0);
107 QString text = idx.isValid()? model->data(idx, Qt::DisplayRole).toString(): QString();
112 idx = model->index(glyphRow, 0, idx);
113 text = model->data(idx, Qt::DisplayRole).toString();
117 if (!text.isEmpty()) {
120 if (!otf.isEmpty()) {
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
GlyphPaletteDialog(QWidget *parent=nullptr)
void slotHidePopupPalette()
void slotInsertRichText(const int charRow, const int glyphRow=-1, const bool replace=false, const bool useCharMap=false)
KoFontGlyphModel * m_model
GlyphPaletteProxyModel * m_charMapModel
QPair< KoSvgTextProperties, KoSvgTextProperties > m_lastUsedProperties
void signalInsertRichText(KoSvgTextShape *text, bool replace)
GlyphPaletteAltPopup * m_altPopup
void slotShowPopupPalette(const int charRow, const int x=0, const int y=0, const int cellWidth=100, const int cellHeight=100)
void setGlyphModelFromProperties(const QPair< KoSvgTextProperties, KoSvgTextProperties > &properties, const QString &text)
setGlyphModelFromProperties This updates the glyph model.
KisQQuickWidget * m_quickWidget
The GlyphPaletteProxyModel class.
A dialog base class with standard buttons and predefined layouts.
void setMainWidget(QWidget *widget)
The KoFontGlyphModel class Creates a tree model of all the glyphs in a given face.
void setFace(FT_FaceSP face, QLatin1String language=QLatin1String(), bool samplesOnly=false)
setFace set the face to retrieve glyph data for.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QModelIndex indexForString(QString grapheme)
std::vector< FT_FaceSP > facesForCSSValues(QVector< int > &lengths, KoCSSFontInfo info=KoCSSFontInfo(), const QString &text="", quint32 xRes=72, quint32 yRes=72, bool disableFontMatching=false, const QString &language=QString())
facesForCSSValues This selects a font with fontconfig using the given values. If "text" is not empty ...
static KoFontRegistry * instance()
@ FontFeatureSettingsId
QStringList.
@ FontVariationSettingsId
QStringList.
@ TextLanguage
a language string.
void setProperty(PropertyId id, const QVariant &value)
void setPropertiesAtPos(int pos, KoSvgTextProperties properties)
setPropertiesAtPos will set the properties at pos.
bool insertText(int pos, QString text)
insertText Insert a text somewhere in the KoTextShape.
rgba palette[MAX_PALETTE]
The KoCSSFontInfo class Convenience struct to make it easier to use KoFontRegistry....