Rename QBasicFontDatabase to QFreeTypeFontDatabase which is what it is
Change-Id: I8def2f7ae1e4c8d8a3e1f8e60549da5d691e4fb3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>bb10
parent
05a943497b
commit
e33b0118b4
|
|
@ -692,7 +692,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, void *usrPtr)
|
|||
|
||||
QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
|
||||
{
|
||||
QFontEngineFT *engine = static_cast<QFontEngineFT*>(QBasicFontDatabase::fontEngine(fontData, pixelSize, hintingPreference));
|
||||
QFontEngineFT *engine = static_cast<QFontEngineFT*>(QFreeTypeFontDatabase::fontEngine(fontData, pixelSize, hintingPreference));
|
||||
if (engine == 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -844,7 +844,7 @@ QStringList QFontconfigDatabase::addApplicationFont(const QByteArray &fontData,
|
|||
|
||||
QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) const
|
||||
{
|
||||
QString resolved = QBasicFontDatabase::resolveFontFamilyAlias(family);
|
||||
QString resolved = QFreeTypeFontDatabase::resolveFontFamilyAlias(family);
|
||||
if (!resolved.isEmpty() && resolved != family)
|
||||
return resolved;
|
||||
FcPattern *pattern = FcPatternCreate();
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@
|
|||
//
|
||||
|
||||
#include <qpa/qplatformfontdatabase.h>
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QFontEngineFT;
|
||||
|
||||
class QFontconfigDatabase : public QBasicFontDatabase
|
||||
class QFontconfigDatabase : public QFreeTypeFontDatabase
|
||||
{
|
||||
public:
|
||||
void populateFontDatabase() Q_DECL_OVERRIDE;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ darwin {
|
|||
include($$PWD/mac/coretext.pri)
|
||||
} else {
|
||||
qtConfig(freetype) {
|
||||
include($$PWD/basic/basic.pri)
|
||||
include($$PWD/freetype/freetype.pri)
|
||||
}
|
||||
|
||||
unix {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
HEADERS += \
|
||||
$$PWD/qbasicfontdatabase_p.h \
|
||||
$$PWD/qfreetypefontdatabase_p.h \
|
||||
$$PWD/qfontengine_ft_p.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qbasicfontdatabase.cpp \
|
||||
$$PWD/qfreetypefontdatabase.cpp \
|
||||
$$PWD/qfontengine_ft.cpp
|
||||
|
||||
QMAKE_USE_PRIVATE += freetype
|
||||
|
|
@ -311,7 +311,7 @@ protected:
|
|||
private:
|
||||
friend class QFontEngineFTRawFont;
|
||||
friend class QFontconfigDatabase;
|
||||
friend class QBasicFontDatabase;
|
||||
friend class QFreeTypeFontDatabase;
|
||||
friend class QCoreTextFontDatabase;
|
||||
friend class QFontEngineMultiFontConfig;
|
||||
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qbasicfontdatabase_p.h"
|
||||
#include "qfreetypefontdatabase_p.h"
|
||||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
void QBasicFontDatabase::populateFontDatabase()
|
||||
void QFreeTypeFontDatabase::populateFontDatabase()
|
||||
{
|
||||
QString fontpath = fontDir();
|
||||
QDir dir(fontpath);
|
||||
|
|
@ -79,11 +79,11 @@ void QBasicFontDatabase::populateFontDatabase()
|
|||
const auto fis = dir.entryInfoList(nameFilters, QDir::Files);
|
||||
for (const QFileInfo &fi : fis) {
|
||||
const QByteArray file = QFile::encodeName(fi.absoluteFilePath());
|
||||
QBasicFontDatabase::addTTFile(QByteArray(), file);
|
||||
QFreeTypeFontDatabase::addTTFile(QByteArray(), file);
|
||||
}
|
||||
}
|
||||
|
||||
QFontEngine *QBasicFontDatabase::fontEngine(const QFontDef &fontDef, void *usrPtr)
|
||||
QFontEngine *QFreeTypeFontDatabase::fontEngine(const QFontDef &fontDef, void *usrPtr)
|
||||
{
|
||||
FontFile *fontfile = static_cast<FontFile *> (usrPtr);
|
||||
QFontEngine::FaceId fid;
|
||||
|
|
@ -147,7 +147,7 @@ namespace {
|
|||
|
||||
}
|
||||
|
||||
QFontEngine *QBasicFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize,
|
||||
QFontEngine *QFreeTypeFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize,
|
||||
QFont::HintingPreference hintingPreference)
|
||||
{
|
||||
QFontDef fontDef;
|
||||
|
|
@ -166,12 +166,12 @@ QFontEngine *QBasicFontDatabase::fontEngine(const QByteArray &fontData, qreal pi
|
|||
return fe;
|
||||
}
|
||||
|
||||
QStringList QBasicFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
|
||||
QStringList QFreeTypeFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
|
||||
{
|
||||
return QBasicFontDatabase::addTTFile(fontData, fileName.toLocal8Bit());
|
||||
return QFreeTypeFontDatabase::addTTFile(fontData, fileName.toLocal8Bit());
|
||||
}
|
||||
|
||||
void QBasicFontDatabase::releaseHandle(void *handle)
|
||||
void QFreeTypeFontDatabase::releaseHandle(void *handle)
|
||||
{
|
||||
FontFile *file = static_cast<FontFile *>(handle);
|
||||
delete file;
|
||||
|
|
@ -179,7 +179,7 @@ void QBasicFontDatabase::releaseHandle(void *handle)
|
|||
|
||||
extern FT_Library qt_getFreetype();
|
||||
|
||||
QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByteArray &file)
|
||||
QStringList QFreeTypeFontDatabase::addTTFile(const QByteArray &fontData, const QByteArray &file)
|
||||
{
|
||||
FT_Library library = qt_getFreetype();
|
||||
|
||||
|
|
@ -37,8 +37,8 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QBASICFONTDATABASE_H
|
||||
#define QBASICFONTDATABASE_H
|
||||
#ifndef QFREETYPEFONTDATABASE_H
|
||||
#define QFREETYPEFONTDATABASE_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
|
|
@ -63,7 +63,7 @@ struct FontFile
|
|||
int indexValue;
|
||||
};
|
||||
|
||||
class QBasicFontDatabase : public QPlatformFontDatabase
|
||||
class QFreeTypeFontDatabase : public QPlatformFontDatabase
|
||||
{
|
||||
public:
|
||||
void populateFontDatabase() Q_DECL_OVERRIDE;
|
||||
|
|
@ -77,4 +77,4 @@ public:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QBASICFONTDATABASE_H
|
||||
#endif // QFREETYPEFONTDATABASE_H
|
||||
|
|
@ -57,8 +57,8 @@
|
|||
#include <QtFontDatabaseSupport/private/qfontconfigdatabase_p.h>
|
||||
typedef QFontconfigDatabase QGenericUnixFontDatabase;
|
||||
#else
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
typedef QBasicFontDatabase QGenericUnixFontDatabase;
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
typedef QFreeTypeFontDatabase QGenericUnixFontDatabase;
|
||||
#endif //Q_FONTCONFIGDATABASE
|
||||
|
||||
#endif // QGENERICUNIXFONTDATABASE_H
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ OBJECTIVE_SOURCES += $$PWD/qfontengine_coretext.mm $$PWD/qcoretextfontdatabase.m
|
|||
|
||||
qtConfig(freetype) {
|
||||
QMAKE_USE_PRIVATE += freetype
|
||||
HEADERS += basic/qfontengine_ft_p.h
|
||||
SOURCES += basic/qfontengine_ft.cpp
|
||||
HEADERS += freetype/qfontengine_ft_p.h
|
||||
SOURCES += freetype/qfontengine_ft.cpp
|
||||
}
|
||||
|
||||
uikit: \
|
||||
|
|
|
|||
|
|
@ -393,14 +393,14 @@ void QWindowsFontDatabaseFT::populateFontDatabase()
|
|||
|
||||
QFontEngine * QWindowsFontDatabaseFT::fontEngine(const QFontDef &fontDef, void *handle)
|
||||
{
|
||||
QFontEngine *fe = QBasicFontDatabase::fontEngine(fontDef, handle);
|
||||
QFontEngine *fe = QFreeTypeFontDatabase::fontEngine(fontDef, handle);
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << "FONTDEF" << fontDef.family << fe << handle;
|
||||
return fe;
|
||||
}
|
||||
|
||||
QFontEngine *QWindowsFontDatabaseFT::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
|
||||
{
|
||||
QFontEngine *fe = QBasicFontDatabase::fontEngine(fontData, pixelSize, hintingPreference);
|
||||
QFontEngine *fe = QFreeTypeFontDatabase::fontEngine(fontData, pixelSize, hintingPreference);
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << "FONTDATA" << fontData << pixelSize << hintingPreference << fe;
|
||||
return fe;
|
||||
}
|
||||
|
|
@ -410,7 +410,7 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString &family, QF
|
|||
QStringList result;
|
||||
result.append(QWindowsFontDatabase::familyForStyleHint(styleHint));
|
||||
result.append(QWindowsFontDatabase::extraTryFontsForFamily(family));
|
||||
result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << family << style << styleHint
|
||||
<< script << result;
|
||||
|
|
|
|||
|
|
@ -51,13 +51,13 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QWindowsFontDatabaseFT : public QBasicFontDatabase
|
||||
class QWindowsFontDatabaseFT : public QFreeTypeFontDatabase
|
||||
{
|
||||
public:
|
||||
void populateFontDatabase() Q_DECL_OVERRIDE;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ QWinRTFontDatabase::~QWinRTFontDatabase()
|
|||
QString QWinRTFontDatabase::fontDir() const
|
||||
{
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__;
|
||||
QString fontDirectory = QBasicFontDatabase::fontDir();
|
||||
QString fontDirectory = QFreeTypeFontDatabase::fontDir();
|
||||
if (!QFile::exists(fontDirectory)) {
|
||||
// Fall back to app directory + fonts, and just app directory after that
|
||||
const QString applicationDirPath = QCoreApplication::applicationDirPath();
|
||||
|
|
@ -176,7 +176,7 @@ void QWinRTFontDatabase::populateFontDatabase()
|
|||
HRESULT hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, __uuidof(IDWriteFactory1), &factory);
|
||||
if (FAILED(hr)) {
|
||||
qWarning("Failed to create DirectWrite factory: %s", qPrintable(qt_error_string(hr)));
|
||||
QBasicFontDatabase::populateFontDatabase();
|
||||
QFreeTypeFontDatabase::populateFontDatabase();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ void QWinRTFontDatabase::populateFontDatabase()
|
|||
hr = factory->GetSystemFontCollection(&fontCollection);
|
||||
if (FAILED(hr)) {
|
||||
qWarning("Failed to open system font collection: %s", qPrintable(qt_error_string(hr)));
|
||||
QBasicFontDatabase::populateFontDatabase();
|
||||
QFreeTypeFontDatabase::populateFontDatabase();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ void QWinRTFontDatabase::populateFontDatabase()
|
|||
registerFontFamily(familyName);
|
||||
}
|
||||
|
||||
QBasicFontDatabase::populateFontDatabase();
|
||||
QFreeTypeFontDatabase::populateFontDatabase();
|
||||
}
|
||||
|
||||
void QWinRTFontDatabase::populateFamily(const QString &familyName)
|
||||
|
|
@ -399,7 +399,7 @@ QFontEngine *QWinRTFontDatabase::fontEngine(const QFontDef &fontDef, void *handl
|
|||
|
||||
IDWriteFontFile *fontFile = reinterpret_cast<IDWriteFontFile *>(handle);
|
||||
if (!m_fonts.contains(fontFile))
|
||||
return QBasicFontDatabase::fontEngine(fontDef, handle);
|
||||
return QFreeTypeFontDatabase::fontEngine(fontDef, handle);
|
||||
|
||||
const void *referenceKey;
|
||||
quint32 referenceKeySize;
|
||||
|
|
@ -468,7 +468,7 @@ QStringList QWinRTFontDatabase::fallbacksForFamily(const QString &family, QFont:
|
|||
QStringList result;
|
||||
if (family == QLatin1String("Helvetica"))
|
||||
result.append(QStringLiteral("Arial"));
|
||||
result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ void QWinRTFontDatabase::releaseHandle(void *handle)
|
|||
return;
|
||||
}
|
||||
|
||||
QBasicFontDatabase::releaseHandle(handle);
|
||||
QFreeTypeFontDatabase::releaseHandle(handle);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
#include <QtCore/QLoggingCategory>
|
||||
|
||||
struct IDWriteFontFile;
|
||||
|
|
@ -67,7 +67,7 @@ struct FontDescription
|
|||
QByteArray uuid;
|
||||
};
|
||||
|
||||
class QWinRTFontDatabase : public QBasicFontDatabase
|
||||
class QWinRTFontDatabase : public QFreeTypeFontDatabase
|
||||
{
|
||||
public:
|
||||
~QWinRTFontDatabase();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void QAndroidPlatformFontDatabase::populateFontDatabase()
|
|||
const auto entries = dir.entryInfoList(nameFilters, QDir::Files);
|
||||
for (const QFileInfo &fi : entries) {
|
||||
const QByteArray file = QFile::encodeName(fi.absoluteFilePath());
|
||||
QBasicFontDatabase::addTTFile(QByteArray(), file);
|
||||
QFreeTypeFontDatabase::addTTFile(QByteArray(), file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ QStringList QAndroidPlatformFontDatabase::fallbacksForFamily(const QString &fami
|
|||
result.append(QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(QLatin1Char(';')));
|
||||
else
|
||||
result.append(QString(qgetenv("QT_ANDROID_FONTS")).split(QLatin1Char(';')));
|
||||
result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@
|
|||
#ifndef QANDROIDPLATFORMFONTDATABASE_H
|
||||
#define QANDROIDPLATFORMFONTDATABASE_H
|
||||
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAndroidPlatformFontDatabase: public QBasicFontDatabase
|
||||
class QAndroidPlatformFontDatabase: public QFreeTypeFontDatabase
|
||||
{
|
||||
public:
|
||||
QString fontDir() const override;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformwindow.h>
|
||||
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
#if defined(Q_OS_WINRT)
|
||||
# include <QtFontDatabaseSupport/private/qwinrtfontdatabase_p.h>
|
||||
#elif defined(Q_OS_WIN)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
|
||||
#endif
|
||||
#elif defined(Q_OS_WIN)
|
||||
#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h>
|
||||
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
|
||||
#ifndef Q_OS_WINRT
|
||||
#include <QtCore/private/qeventdispatcher_win_p.h>
|
||||
#else
|
||||
|
|
@ -103,7 +103,7 @@ QOffscreenIntegration::QOffscreenIntegration()
|
|||
m_fontDatabase.reset(new QGenericUnixFontDatabase());
|
||||
#endif
|
||||
#elif defined(Q_OS_WIN)
|
||||
m_fontDatabase.reset(new QBasicFontDatabase());
|
||||
m_fontDatabase.reset(new QFreeTypeFontDatabase());
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
|
|
|||
Loading…
Reference in New Issue