summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qrawfont.cpp')
-rw-r--r--src/gui/text/qrawfont.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 44ddfd2d75..1c7d5ad4b6 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -718,6 +718,20 @@ void QRawFontPrivate::cleanUp()
hintingPreference = QFont::PreferDefaultHinting;
}
+/*!
+ Returns the smallest rectangle containing the glyph with the given \a glyphIndex.
+
+ \since 5.0
+*/
+QRectF QRawFont::boundingRect(quint32 glyphIndex) const
+{
+ if (!isValid())
+ return QRectF();
+
+ glyph_metrics_t gm = d->fontEngine->boundingBox(glyphIndex);
+ return QRectF(gm.x.toReal(), gm.y.toReal(), gm.width.toReal(), gm.height.toReal());
+}
+
#endif // QT_NO_RAWFONT
QT_END_NAMESPACE