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
qglyphrun.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 QGLYPHRUN_H
5#define QGLYPHRUN_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qlist.h>
9#include <QtCore/qpoint.h>
10#include <QtGui/qrawfont.h>
11#include <QtCore/qshareddata.h>
12
13#if !defined(QT_NO_RAWFONT)
14
15QT_BEGIN_NAMESPACE
16
17
18class QGlyphRunPrivate;
19class Q_GUI_EXPORT QGlyphRun
20{
21public:
22 enum GlyphRunFlag {
23 Overline = 0x01,
24 Underline = 0x02,
25 StrikeOut = 0x04,
26 RightToLeft = 0x08,
27 SplitLigature = 0x10
28 };
29 Q_DECLARE_FLAGS(GlyphRunFlags, GlyphRunFlag)
30
31 QGlyphRun();
32 QGlyphRun(const QGlyphRun &other);
33 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGlyphRun)
34 QGlyphRun &operator=(const QGlyphRun &other);
35 ~QGlyphRun();
36
37 void swap(QGlyphRun &other) noexcept { d.swap(other.d); }
38
39 QRawFont rawFont() const;
40 void setRawFont(const QRawFont &rawFont);
41
42 void setRawData(const quint32 *glyphIndexArray,
43 const QPointF *glyphPositionArray,
44 int size);
45
46 QList<quint32> glyphIndexes() const;
47 void setGlyphIndexes(const QList<quint32> &glyphIndexes);
48
49 QList<QPointF> positions() const;
50 void setPositions(const QList<QPointF> &positions);
51
52 void clear();
53
54 bool operator==(const QGlyphRun &other) const;
55 inline bool operator!=(const QGlyphRun &other) const
56 { return !operator==(other); }
57
58 void setOverline(bool overline);
59 bool overline() const;
60
61 void setUnderline(bool underline);
62 bool underline() const;
63
64 void setStrikeOut(bool strikeOut);
65 bool strikeOut() const;
66
67 void setRightToLeft(bool on);
68 bool isRightToLeft() const;
69
70 void setFlag(GlyphRunFlag flag, bool enabled = true);
71 void setFlags(GlyphRunFlags flags);
72 GlyphRunFlags flags() const;
73
74 void setBoundingRect(const QRectF &boundingRect);
75 QRectF boundingRect() const;
76
77 QList<qsizetype> stringIndexes() const;
78 void setStringIndexes(const QList<qsizetype> &stringIndexes);
79
80 void setSourceString(const QString &sourceString);
81 QString sourceString() const;
82
83 bool isEmpty() const;
84
85private:
86 friend class QGlyphRunPrivate;
87 friend class QTextLine;
88
89 QGlyphRun operator+(const QGlyphRun &other) const;
90 QGlyphRun &operator+=(const QGlyphRun &other);
91
92 void detach();
93 QExplicitlySharedDataPointer<QGlyphRunPrivate> d;
94};
95
97
98QT_END_NAMESPACE
99
100#endif // QT_NO_RAWFONT
101
102#endif // QGLYPHRUN_H
The QGlyphRun class provides direct access to the internal glyphs in a font.
Definition qglyphrun.h:20
\inmodule QtGui
Definition qimage.h:37
friend class QPainter
QPainterPathStroker(const QPen &pen)
Creates a new stroker based on pen.
\inmodule QtGui
void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation)
Definition qpainter.cpp:474
QPaintEngineEx * extended
Definition qpainter_p.h:243
QPaintDevice * helper_device
Definition qpainter_p.h:231
void initFrom(const QPaintDevice *device)
void updateMatrix()
Definition qpainter.cpp:627
void updateInvMatrix()
Definition qpainter.cpp:647
void draw_helper(const QPainterPath &path, DrawOperation operation=StrokeAndFillDraw)
Definition qpainter.cpp:318
QPainter * q_ptr
Definition qpainter_p.h:164
void drawStretchedGradient(const QPainterPath &path, DrawOperation operation)
Definition qpainter.cpp:512
QTransform hidpiScaleTransform() const
Definition qpainter.cpp:229
QPaintDevice * device
Definition qpainter_p.h:229
QTransform viewTransform() const
Definition qpainter.cpp:209
qreal effectiveDevicePixelRatio() const
Definition qpainter.cpp:220
void checkEmulation()
Definition qpainter.cpp:173
void drawGlyphs(const QPointF &decorationPosition, const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount, QFontEngine *fontEngine, bool overline=false, bool underline=false, bool strikeOut=false)
friend class QFontEngine
Definition qpainter.h:432
friend class QTextEngine
Definition qpainter.h:445
\inmodule QtCore\reentrant
Definition qpoint.h:231
The QStaticText class enables optimized drawing of text when the text and its layout is updated rarel...
Definition qstatictext.h:21
Internal QTextItem.
\reentrant
Definition qtextlayout.h:70
Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush)
Definition qbrush.cpp:875
#define QPaintEngine_OpaqueBackground
Definition qpainter.cpp:54
void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, const QString &str, QRectF *brect, int tabstops, int *ta, int tabarraylen, QPainter *painter)
static void qt_draw_decoration_for_glyphs(QPainter *painter, const QPointF &decorationPosition, const glyph_t *glyphArray, const QFixedPoint *positions, int glyphCount, QFontEngine *fontEngine, bool underline, bool overline, bool strikeOut)
static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine, QTextCharFormat::UnderlineStyle underlineStyle, QTextItem::RenderFlags flags, qreal width, const QTextCharFormat &charFormat)
static bool needsEmulation(const QBrush &brush)
Definition qpainter.cpp:156
static bool needsResolving(const QBrush &brush)
void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *option, const QString &str, QRectF *brect, int tabstops, int *tabarray, int tabarraylen, QPainter *painter)
static QPointF roundInDeviceCoordinates(const QPointF &p, const QTransform &m)
QPixmap qt_pixmapForBrush(int style, bool invert)
Definition qbrush.cpp:80
static bool is_brush_transparent(const QBrush &brush)
Definition qpainter.cpp:97
void qt_format_text(const QFont &fnt, const QRectF &_r, int tf, int alignment, const QTextOption *option, const QString &str, QRectF *brect, int tabstops, int *ta, int tabarraylen, QPainter *painter)
static QBrush stretchGradientToUserSpace(const QBrush &brush, const QRectF &boundingRect)
Definition qpainter.cpp:493
static bool qt_painter_thread_test(int devType, int engineType, const char *what)
Definition qpainter.cpp:129
static void qt_cleanup_painter_state(QPainterPrivate *d)
static QGradient::CoordinateMode coordinateMode(const QBrush &brush)
Definition qpainter.cpp:82
static uint line_emulation(uint emulation)
Definition qpainter.cpp:116
static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen)
#define QGradient_StretchToDevice
Definition qpainter.cpp:53
static bool is_pen_transparent(const QPen &pen)
Definition qpainter.cpp:109
bool qHasPixmapTexture(const QBrush &)
Definition qbrush.cpp:206
Q_GUI_EXPORT void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivate::DrawOperation operation)