Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsvgfont_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
4#ifndef QSVGFONT_P_H
5#define QSVGFONT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qpainterpath.h"
19#include "qhash.h"
20#include "qstring.h"
21#include "qsvgstyle_p.h"
22#include "qtsvgglobal_p.h"
23
25
26class Q_SVG_EXPORT QSvgGlyph
27{
28public:
29 QSvgGlyph(QChar unicode, const QPainterPath &path, qreal horizAdvX);
30 QSvgGlyph() : m_unicode(0), m_horizAdvX(0) {}
31
35};
36
37
38class Q_SVG_EXPORT QSvgFont : public QSvgRefCounted
39{
40public:
41 static constexpr qreal DEFAULT_UNITS_PER_EM = 1000;
42 QSvgFont(qreal horizAdvX);
43
44 void setFamilyName(const QString &name);
45 QString familyName() const;
46
47 void setUnitsPerEm(qreal upem);
48
49 void addGlyph(QChar unicode, const QPainterPath &path, qreal horizAdvX = -1);
50
51 void draw(QPainter *p, const QPointF &point, const QString &str, qreal pixelSize, Qt::Alignment alignment) const;
52public:
54 qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM;
56 QHash<QChar, QSvgGlyph> m_glyphs;
57};
58
60
61#endif // QSVGFONT_P_H
\inmodule QtCore
\inmodule QtGui
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qpoint.h:217
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
qreal m_horizAdvX
Definition qsvgfont_p.h:55
QString m_familyName
Definition qsvgfont_p.h:53
QHash< QChar, QSvgGlyph > m_glyphs
Definition qsvgfont_p.h:56
QPainterPath m_path
Definition qsvgfont_p.h:33
QChar m_unicode
Definition qsvgfont_p.h:32
qreal m_horizAdvX
Definition qsvgfont_p.h:34
QString str
[2]
uint alignment
Combined button and popup list for selecting options.
GLuint name
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
double qreal
Definition qtypes.h:187
myFilter draw(painter, QPoint(0, 0), originalPixmap)