summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-08-23 12:25:05 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-08-24 06:11:07 +0000
commit660c34077eb97c3aa49671fe555ecca717933e0d (patch)
tree310062923412c269ad3177f5dcbe1e18abe01638 /src/gui
parent95c767f5be3cd42b4ed79eeed6fd4aa6cc29dc16 (diff)
DirectWrite: Fix crash when embedding empty glyphs in PDF
Empty QPainterPaths can have one move-to element, so the test to detect this case was incomplete. For empty glyphs returned from DirectWrite this would trigger a crash. This is only reproducible after also enabling embedding of fonts with the DirectWrite engine. Task-number: QTBUG-54740 Change-Id: I3fbbfb8d958818550d5ab5234242d39688b84811 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qfontsubset.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 49638832e0..92eeaf7919 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -966,7 +966,7 @@ static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advanc
glyph.advanceWidth = qRound(advance * 2048. / ppem);
glyph.lsb = qRound(lsb * 2048. / ppem);
- if (!path.elementCount()) {
+ if (path.isEmpty()) {
//qDebug("glyph %d is empty", index);
lsb = 0;
glyph.xMin = glyph.xMax = glyph.yMin = glyph.yMax = 0;