#ifndef QT_NO_FREETYPE
#include "qfile.h"
-#include "qabstractfileengine.h"
+#include "qfileinfo.h"
#include "qthreadstorage.h"
#include <qmath.h>
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.
QScopedPointer<QFreetypeFace> 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;
}
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
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;