Krita Source Code Documentation
Loading...
Searching...
No Matches
KoFontGlyphModel.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KOFONTGLYPHMODEL_H
7#define KOFONTGLYPHMODEL_H
8
9#include <QAbstractItemModel>
10#include <QScopedPointer>
13#include "kritaflake_export.h"
14
23class KRITAFLAKE_EXPORT KoFontGlyphModel: public QAbstractItemModel
24{
25 Q_OBJECT
26public:
32
33 KoFontGlyphModel(QObject *parent = nullptr);
35
36 enum Roles {
37 OpenTypeFeatures = Qt::UserRole + 1,
39 ChildCount
40 };
41
42 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
43
44 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
45 QModelIndex parent(const QModelIndex &child) const override;
46 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
47 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
48 bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
49
50 QModelIndex indexForString(QString grapheme);
51
59 void setFace(FT_FaceSP face, QLatin1String language = QLatin1String(), bool samplesOnly = false);
60
61 QHash<int, QByteArray> roleNames() const override;
62
67 QVector<KoUnicodeBlockData> blocks() const;
68
73 QMap<QString, KoOpenTypeFeatureInfo> featureInfo() const;
74
75private:
76 struct Private;
77 QScopedPointer<Private> d;
78};
79
80#endif // KOFONTGLYPHMODEL_H
The KoFontGlyphModel class Creates a tree model of all the glyphs in a given face.
QScopedPointer< Private > d