54 : m_unicode(unicode), m_path(path), m_horizAdvX(horizAdvX)
88 for ( ; itr != str.
constEnd(); ++itr) {
95 textWidth +=
static_cast<int>(
m_glyphs[unicode].m_horizAdvX);
98 QPoint alignmentOffset(0, 0);
100 alignmentOffset.
setX(-textWidth / 2);
102 alignmentOffset.
setX(-textWidth);
116 for ( ; itr != str.
constEnd(); ++itr) {
117 QChar unicode = *itr;
The QPainter class performs low-level painting on widgets and other paint devices.
QSvgFont(qreal horizAdvX)
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
#define QT_END_NAMESPACE
This macro expands to.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QPointF class defines a point in the plane using floating point precision.
void restore()
Restores the current painter state (pops a saved state off the stack).
The QString class provides a Unicode character string.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
The QChar class provides a 16-bit Unicode character.
void save()
Saves the current painter state (pushes the state onto a stack).
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first character in the string. ...
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static float pixelSize(const QFontDef &request, int dpi)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
void setFamilyName(const QString &name)
void setUnitsPerEm(qreal upem)
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
The QPoint class defines a point in the plane using integer precision.
void draw(QPainter *p, const QPointF &point, const QString &str, qreal pixelSize, Qt::Alignment alignment) const
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
void addGlyph(QChar unicode, const QPainterPath &path, qreal horizAdvX=-1)
qreal widthF() const
Returns the pen width with floating point precision.
QHash< QChar, QSvgGlyph > m_glyphs
void scale(qreal sx, qreal sy)
Scales the coordinate system by ({sx}, {sy}).
QString familyName() const
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.