winphone: Remove old non-DirectWrite code
Since 8.1, DirectWrite is always used on WinRT platforms. Change-Id: I742e4a48be6c478a62c16a32cf89852b850aff9d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
This commit is contained in:
parent
4a552d95f6
commit
18c4a08623
@ -39,13 +39,11 @@
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
#include <QtCore/QUuid>
|
||||
#include <QtGui/private/qfontengine_ft_p.h>
|
||||
#include <dwrite_1.h>
|
||||
#include <wrl.h>
|
||||
using namespace Microsoft::WRL;
|
||||
#endif // QT_WINRT_USE_DWRITE
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -122,9 +120,7 @@ QString QWinRTFontDatabase::fontDir() const
|
||||
const QString applicationDirPath = QCoreApplication::applicationDirPath();
|
||||
fontDirectory = applicationDirPath + QLatin1String("/fonts");
|
||||
if (!QFile::exists(fontDirectory)) {
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
if (m_fontFamilies.isEmpty())
|
||||
#endif
|
||||
qWarning("No fonts directory found in application package.");
|
||||
fontDirectory = applicationDirPath;
|
||||
}
|
||||
@ -132,8 +128,6 @@ QString QWinRTFontDatabase::fontDir() const
|
||||
return fontDirectory;
|
||||
}
|
||||
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
|
||||
QWinRTFontDatabase::~QWinRTFontDatabase()
|
||||
{
|
||||
foreach (IDWriteFontFile *fontFile, m_fonts.keys())
|
||||
@ -449,13 +443,4 @@ void QWinRTFontDatabase::releaseHandle(void *handle)
|
||||
QBasicFontDatabase::releaseHandle(handle);
|
||||
}
|
||||
|
||||
#else // QT_WINRT_USE_DWRITE
|
||||
|
||||
QFont QWinRTFontDatabase::defaultFont() const
|
||||
{
|
||||
return QFont(QFontDatabase().families().value(0));
|
||||
}
|
||||
|
||||
#endif // !QT_WINRT_USE_DWRITE
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -39,26 +39,21 @@
|
||||
|
||||
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
|
||||
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
struct IDWriteFontFile;
|
||||
struct IDWriteFontFamily;
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
struct FontDescription
|
||||
{
|
||||
quint32 index;
|
||||
QByteArray uuid;
|
||||
};
|
||||
#endif
|
||||
|
||||
class QWinRTFontDatabase : public QBasicFontDatabase
|
||||
{
|
||||
public:
|
||||
QString fontDir() const;
|
||||
#ifdef QT_WINRT_USE_DWRITE
|
||||
~QWinRTFontDatabase();
|
||||
QFont defaultFont() const Q_DECL_OVERRIDE;
|
||||
bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
|
||||
@ -69,7 +64,6 @@ public:
|
||||
private:
|
||||
QHash<IDWriteFontFile *, FontDescription> m_fonts;
|
||||
QHash<QString, IDWriteFontFamily *> m_fontFamilies;
|
||||
#endif // QT_WINRT_USE_DWRITE
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -1,14 +1,6 @@
|
||||
TARGET = qwinrt
|
||||
CONFIG -= precompile_header
|
||||
|
||||
# For Windows Phone 8 we have to deploy fonts together with the application as DirectWrite
|
||||
# is not supported here.
|
||||
winphone:equals(WINSDK_VER, 8.0): {
|
||||
fonts.path = $$[QT_INSTALL_LIBS]/fonts
|
||||
fonts.files = $$QT_SOURCE_TREE/lib/fonts/DejaVu*.ttf
|
||||
INSTALLS += fonts
|
||||
}
|
||||
|
||||
PLUGIN_TYPE = platforms
|
||||
PLUGIN_CLASS_NAME = QWinRTIntegrationPlugin
|
||||
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
|
||||
@ -18,13 +10,8 @@ QT += core-private gui-private platformsupport-private
|
||||
|
||||
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__ GL_GLEXT_PROTOTYPES
|
||||
|
||||
LIBS += $$QMAKE_LIBS_CORE
|
||||
|
||||
!if(winphone:equals(WINSDK_VER, 8.0)) {
|
||||
LIBS += -ldwrite
|
||||
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/freetype/include
|
||||
DEFINES += QT_WINRT_USE_DWRITE
|
||||
}
|
||||
LIBS += $$QMAKE_LIBS_CORE -ldwrite
|
||||
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/freetype/include
|
||||
|
||||
SOURCES = \
|
||||
main.cpp \
|
||||
|
Loading…
Reference in New Issue
Block a user