9QSGSoftwareGlyphNode::QSGSoftwareGlyphNode()
10 : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 0)
11 , m_style(QQuickText::Normal)
13 setMaterial((QSGMaterial*)1);
14 setGeometry(&m_geometry);
35 glyph_metrics_t gm = fontEngine->alphaMapBoundingBox(glyphIndexes.at(i), QFixedPoint(), QTransform(), glyphFormat);
53 QRectF boundingRect(QPointF(minX.toReal(), minY.toReal()), QPointF(maxX.toReal(), maxY.toReal()));
97void QSGSoftwareGlyphNode::paint(QPainter *painter)
99 painter->setBrush(QBrush());
100 QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent());
103 if (painter->device()->devicePixelRatio() > 0.0)
104 offset = 1.0 / painter->device()->devicePixelRatio();
107 case QQuickText::Normal:
break;
108 case QQuickText::Outline:
109 painter->setPen(m_styleColor);
110 painter->drawGlyphRun(pos + QPointF(0, offset), m_glyphRun);
111 painter->drawGlyphRun(pos + QPointF(0, -offset), m_glyphRun);
112 painter->drawGlyphRun(pos + QPointF(offset, 0), m_glyphRun);
113 painter->drawGlyphRun(pos + QPointF(-offset, 0), m_glyphRun);
115 case QQuickText::Raised:
116 painter->setPen(m_styleColor);
117 painter->drawGlyphRun(pos + QPointF(0, offset), m_glyphRun);
119 case QQuickText::Sunken:
120 painter->setPen(m_styleColor);
121 painter->drawGlyphRun(pos + QPointF(0, -offset), m_glyphRun);
125 painter->setPen(m_color);
126 painter->drawGlyphRun(pos, m_glyphRun);