15 : m_geometry(
QSGGeometry::defaultAttributes_TexturedPoint2D(), 0)
22 m_fontColorPaint = vgCreatePaint();
23 m_styleColorPaint = vgCreatePaint();
34 vgDestroyPaint(m_fontColorPaint);
35 vgDestroyPaint(m_styleColorPaint);
41 auto oldGlyphCache = m_glyphCache;
43 if (m_glyphCache != oldGlyphCache) {
54 m_xAdjustments.clear();
55 m_yAdjustments.clear();
66 vgSetParameteri(m_fontColorPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
78 vgSetParameteri(m_styleColorPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
106 vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
116 vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
123 vgSetPaint(m_styleColorPaint, VG_FILL_PATH);
130 vgSetPaint(m_styleColorPaint, VG_FILL_PATH);
134 vgSetPaint(m_styleColorPaint, VG_FILL_PATH);
140 vgSetPaint(m_fontColorPaint, VG_FILL_PATH);
141 drawGlyphsAtOffset(
QPointF(0.0, 0.0));
144 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
147 vgDrawImage(offscreenSurface->
image());
148 delete offscreenSurface;
162void QSGOpenVGGlyphNode::drawGlyphsAtOffset(
const QPointF &
offset)
166 origin[0] = firstPosition.
x() +
offset.x();
167 origin[1] = firstPosition.
y() +
offset.y();
168 vgSetfv(VG_GLYPH_ORIGIN, 2, origin);
170 vgDrawGlyphs(m_glyphCache->
font(),
173 m_xAdjustments.constData(),
174 m_yAdjustments.constData(),
The QColor class provides colors based on RGB, HSV or CMYK values.
The QGlyphRun class provides direct access to the internal glyphs in a font.
QList< quint32 > glyphIndexes() const
Returns the glyph indexes for this QGlyphRun object.
QRawFont rawFont() const
Returns the font selected for this QGlyphRun object.
QRectF boundingRect() const
Returns the smallest rectangle that contains all glyphs in this QGlyphRun.
QList< QPointF > positions() const
Returns the position of the edge of the baseline for each glyph in this set of glyph indexes.
const_pointer constData() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
qreal ascent() const
Returns the ascent of this QRawFont in pixel units.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
The QSGMaterial class encapsulates rendering state for a shader program.
void populate(const QVector< quint32 > &glyphs)
void release(const QVector< quint32 > &glyphs)
void setColor(const QColor &color) override
void setStyle(QQuickText::TextStyle style) override
QSGOpenVGGlyphNode(QSGRenderContext *rc)
void setStyleColor(const QColor &color) override
void setPreferredAntialiasingMode(AntialiasingMode) override
QPointF baseLine() const override
void setOpacity(float opacity) override
void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override
QSGOpenVGFontGlyphCache * glyphCache(const QRawFont &rawFont)
const QOpenVGMatrix & transform() const
virtual void setOpacity(float opacity)
const QVector< VGfloat > qColorToVGColor(const QColor &color, float opacity)
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)