Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
distancefieldmodelworker.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef DISTANCEFIELDMODELWORKER_H
5#define DISTANCEFIELDMODELWORKER_H
6
7#include <QObject>
8#include <QRawFont>
9#include <QtGui/private/qtextengine_p.h>
10
12
13struct CmapSubtable0;
14struct CmapSubtable4;
15struct CmapSubtable6;
16struct CmapSubtable10;
17struct CmapSubtable12;
19{
21public:
22 explicit DistanceFieldModelWorker(QObject *parent = nullptr);
23
25 Q_INVOKABLE void loadFont(const QString &fileName);
26
27 void readCmapSubtable(const CmapSubtable0 *subtable, const void *end);
28 void readCmapSubtable(const CmapSubtable4 *subtable, const void *end);
29 void readCmapSubtable(const CmapSubtable6 *subtable, const void *end);
30 void readCmapSubtable(const CmapSubtable10 *subtable, const void *end);
31 void readCmapSubtable(const CmapSubtable12 *subtable, const void *end);
32
36 void distanceFieldGenerated(const QImage &distanceField,
37 const QPainterPath &path,
38 glyph_t glyphId,
39 quint32 cmapAssignment);
40 void error(const QString &errorString);
41
42private:
43 void readGlyphCount();
44 void readCmap();
45
46 QRawFont m_font;
47 quint16 m_glyphCount;
48 quint16 m_nextGlyphId;
49 bool m_doubleGlyphResolution;
50 QHash<glyph_t, quint32> m_cmapping;
51};
52
53QT_END_NAMESPACE
54
55#endif // DISTANCEFIELDMODELWORKER_H
void readCmapSubtable(const CmapSubtable4 *subtable, const void *end)
void readCmapSubtable(const CmapSubtable6 *subtable, const void *end)
void readCmapSubtable(const CmapSubtable10 *subtable, const void *end)
void readCmapSubtable(const CmapSubtable12 *subtable, const void *end)
void distanceFieldGenerated(const QImage &distanceField, const QPainterPath &path, glyph_t glyphId, quint32 cmapAssignment)
void readCmapSubtable(const CmapSubtable0 *subtable, const void *end)
void error(const QString &errorString)
Q_INVOKABLE void loadFont(const QString &fileName)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
void setFont(const QString &fileName)
QString nameForUnicodeRange(UnicodeRange range) const
QList< glyph_t > glyphIndexesForUnicodeRange(UnicodeRange range) const
glyph_t glyphIndexForUcs4(quint32 ucs4) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the data for the given role and section in the header with the specified orientation.
QList< UnicodeRange > unicodeRanges() const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the data stored under the given role for the item referred to by the index.
QObject * parent
Definition qobject.h:73
\inmodule QtCore
Definition qobject.h:103
Combined button and popup list for selecting options.