X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fgui%2Ftext%2Fqfontengine_ft.cpp;h=8880eb7cb364221e5569079202304402d153cbc8;hb=933e35ae7e8548ad27c9e85ebfe95ae3eca26619;hp=ca1d6bbc5017c0bc320f5fdbed1df3b6c85fcae0;hpb=5635823e17db3395d9b0fa8cfcc72f82fea583f4;p=profile%2Fivi%2Fqtbase.git diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index ca1d6bb..8880eb7 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -49,7 +49,7 @@ #ifndef QT_NO_FREETYPE #include "qfile.h" -#include "qabstractfileengine.h" +#include "qfileinfo.h" #include "qthreadstorage.h" #include @@ -205,6 +205,8 @@ HB_Error QFreetypeFace::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 p return HB_Err_Ok; } +extern QByteArray qt_fontdata_from_index(int); + /* * One font file can contain more than one font (bold/italic for example) * find the right one and return it. @@ -229,17 +231,17 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id, QScopedPointer newFreetype(new QFreetypeFace); FT_Face face; if (!face_id.filename.isEmpty()) { - QFile file(QString::fromUtf8(face_id.filename)); + QString fileName = QString::fromUtf8(face_id.filename); if (face_id.filename.startsWith(":qmemoryfonts/")) { // from qfontdatabase.cpp - extern QByteArray qt_fontdata_from_index(int); QByteArray idx = face_id.filename; idx.remove(0, 14); // remove ':qmemoryfonts/' bool ok = false; newFreetype->fontData = qt_fontdata_from_index(idx.toInt(&ok)); if (!ok) newFreetype->fontData = QByteArray(); - } else if (!(file.fileEngine()->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)) { + } else if (!QFileInfo(fileName).isNativePath()) { + QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { return 0; } @@ -1171,8 +1173,7 @@ QFixed QFontEngineFT::ascent() const QFixed QFontEngineFT::descent() const { - // subtract a pixel to work around QFontMetrics's built-in + 1 - return QFixed::fromFixed(-metrics.descender - 64); + return QFixed::fromFixed(-metrics.descender); } QFixed QFontEngineFT::leading() const @@ -1587,7 +1588,7 @@ glyph_metrics_t QFontEngineFT::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; + overall.height = ascent() + descent(); QFixed ymax = 0; QFixed xmax = 0;