diff options
Diffstat (limited to 'src/gui/text/qfontengine_s60.cpp')
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index eec09f4..2e1abb2 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -197,27 +227,14 @@ QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph) glyph_metrics_t QFontEngineS60::boundingBox(const QGlyphLayout &glyphs) { - glyph_metrics_t overall; - // initialize with line height, we get the same behaviour on all platforms - overall.y = -ascent(); - overall.height = ascent() + descent() + 1; - - QFixed ymax = 0; - QFixed xmax = 0; - for (int i = 0; i < glyphs.numGlyphs; i++) { - const glyph_metrics_t glyphBounds = boundingBox_const(glyphs.glyphs[i]); - QFixed x = overall.xoff + glyphs.offsets[i].x + glyphBounds.x; - QFixed y = overall.yoff + glyphs.offsets[i].y - glyphBounds.y; - overall.x = qMin(overall.x, x); - overall.y = qMin(overall.y, y); - xmax = qMax(xmax, x + glyphBounds.width); - ymax = qMax(ymax, y + glyphBounds.height); - overall.xoff += glyphBounds.xoff; - } - overall.height = qMax(overall.height, ymax - overall.y); - overall.width = xmax - overall.x; + if (glyphs.numGlyphs == 0) + return glyph_metrics_t(); + + QFixed w = 0; + for (int i = 0; i < glyphs.numGlyphs; ++i) + w += glyphs.effectiveAdvance(i); - return overall; + return glyph_metrics_t(0, -ascent(), w, ascent()+descent()+1, w, 0); } glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const |