summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-09-14 13:37:02 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2009-09-14 13:57:53 (GMT)
commit332ed8a32fa25a12f5316bb0420284c0e3e6fe43 (patch)
tree4ed85b038af6ff38d1279049c91e9296b4547647 /src/gui/text/qtextlayout.cpp
parentdd24168d42df7b474c0fbc9cd943b0556cb4a25f (diff)
downloadQt-332ed8a32fa25a12f5316bb0420284c0e3e6fe43.zip
Qt-332ed8a32fa25a12f5316bb0420284c0e3e6fe43.tar.gz
Qt-332ed8a32fa25a12f5316bb0420284c0e3e6fe43.tar.bz2
If the font does not exist, then the right bearing becomes to big
In the QPF1 engine if the font does not exist, then the default constructor of glyph_metrics_t is used which sets the x and y values to the unlikely value of 100000. These glyph_metrics_t instances are not suppose to be used in the text layout calculations. Task-number: pending
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 62795f8..f8b0cbc 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1807,7 +1807,8 @@ void QTextLine::layout_helper(int maxGlyphs)
QFontEngine *fontEngine = eng->fontEngine(current);
glyph_t glyph = glyphs.glyphs[logClusters[pos - 1]];
glyph_metrics_t gi = fontEngine->boundingBox(glyph);
- lbh.rightBearing = -qRound(gi.xoff - gi.x - gi.width);
+ if (gi.isValid())
+ lbh.rightBearing = -qRound(gi.xoff - gi.x - gi.width);
}
if ((sb_or_ws|breakany) && lbh.checkFullOtherwiseExtend(line)) {