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
qsgcurveglyphatlas_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSGCURVEGLYPHATLAS_P_H
6#define QSGCURVEGLYPHATLAS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/qrawfont.h>
20#include <QtGui/private/qtextengine_p.h>
21#include <QtQuick/qtquickexports.h>
22
23QT_BEGIN_NAMESPACE
24
25class QSGCurveFillNode;
26class QSGCurveStrokeNode;
27
28class Q_QUICK_EXPORT QSGCurveGlyphAtlas
29{
30public:
31 QSGCurveGlyphAtlas(const QRawFont &font);
32 virtual ~QSGCurveGlyphAtlas();
33
34 void populate(const QList<glyph_t> &glyphs);
35 void addGlyph(QSGCurveFillNode *node,
36 glyph_t glyph,
37 const QPointF &position,
38 qreal pixelSize) const;
39 void addStroke(QSGCurveStrokeNode *node,
40 glyph_t glyph,
41 const QPointF &position) const;
42
43 qreal fontSize() const
44 {
45 return m_font.pixelSize();
46 }
47
48private:
49 struct Glyph
50 {
51 QList<QVector2D> vertices;
52 QList<QVector3D> uvs;
53 QList<QVector2D> normals;
54 QList<QVector2D> duvdx;
55 QList<QVector2D> duvdy;
56
57 QList<QVector2D> strokeVertices;
58 QList<QVector2D> strokeUvs;
59 QList<QVector2D> strokeNormals;
60 QList<bool> strokeElementIsLine;
61 };
62
63 QHash<glyph_t, Glyph> m_glyphs;
64 QRawFont m_font;
65};
66
67QT_END_NAMESPACE
68
69
70#endif // QSGCURVEGLYPHATLAS_P_H
Combined button and popup list for selecting options.