Move FreeType font engine/database to QtGui

Task-number: QTBUG-83255
Change-Id: If6be7057d6bd25b34acd99e18658744161985ed0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-03-31 12:25:48 +02:00
parent a64a0ce331
commit da1b0d2d6a
25 changed files with 38 additions and 27 deletions

View File

@ -10,6 +10,7 @@ set(OpenGL_GL_PREFERENCE GLVND) # special case:
qt_find_package(X11_XCB)
qt_find_package(WrapHarfbuzz PROVIDED_TARGETS WrapHarfbuzz::WrapHarfbuzz)
qt_find_package(WrapPNG PROVIDED_TARGETS WrapPNG::WrapPNG)
qt_find_package(WrapFreetype PROVIDED_TARGETS WrapFreetype::WrapFreetype)
if (QT_FEATURE_gui)
if (WINRT)
@ -498,6 +499,14 @@ qt_extend_target(Gui CONDITION QT_FEATURE_png
WrapPNG::WrapPNG
)
qt_extend_target(Gui CONDITION QT_FEATURE_freetype
SOURCES
text/freetype/qfontengine_ft.cpp text/freetype/qfontengine_ft_p.h
text/freetype/qfreetypefontdatabase.cpp text/freetype/qfreetypefontdatabase_p.h
LIBRARIES
WrapFreetype::WrapFreetype
)
#### Keys ignored in scope 39:.:image:image/image.pri:WIN32 AND mingw:
# GCC_VERSION = "$${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.$${QMAKE_GCC_PATCH_VERSION}"

View File

@ -74,7 +74,7 @@ class QFontconfigDatabase;
* This class represents one font file on disk (like Arial.ttf) and is shared between all the font engines
* that show this font file (at different pixel sizes).
*/
class QFreetypeFace
class Q_GUI_EXPORT QFreetypeFace
{
public:
void computeSize(const QFontDef &fontDef, int *xsize, int *ysize, bool *outline_drawing, QFixed *scalableBitmapScaleFactor);
@ -128,7 +128,7 @@ private:
QFontEngine::Holder hbFace;
};
class QFontEngineFT : public QFontEngine
class Q_GUI_EXPORT QFontEngineFT : public QFontEngine
{
public:
struct GlyphInfo {
@ -353,7 +353,7 @@ inline QFontEngineFT::Glyph *QFontEngineFT::QGlyphSet::getGlyph(glyph_t index, Q
return glyph_data.value(GlyphAndSubPixelPosition(index, subPixelPosition));
}
extern FT_Library qt_getFreetype();
Q_GUI_EXPORT FT_Library qt_getFreetype();
QT_END_NAMESPACE

View File

@ -48,7 +48,7 @@
#include <QtCore/QtEndian>
#undef QT_NO_FREETYPE
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include "qfontengine_ft_p.h"
#include <ft2build.h>
#include FT_TRUETYPE_TABLES_H

View File

@ -63,7 +63,7 @@ struct FontFile
int indexValue;
};
class QFreeTypeFontDatabase : public QPlatformFontDatabase
class Q_GUI_EXPORT QFreeTypeFontDatabase : public QPlatformFontDatabase
{
public:
void populateFontDatabase() override;

View File

@ -123,3 +123,7 @@ qtConfig(cssparser) {
SOURCES += \
text/qcssparser.cpp
}
qtConfig(freetype) {
include($$PWD/freetype/freetype.pri)
}

View File

@ -47,9 +47,6 @@ qt_extend_target(FontDatabaseSupport CONDITION APPLE AND NOT MACOS
)
qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype
SOURCES
freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h
freetype/qfreetypefontdatabase.cpp freetype/qfreetypefontdatabase_p.h
LIBRARIES
WrapFreetype::WrapFreetype
)

View File

@ -40,7 +40,7 @@
#include "qfontconfigdatabase_p.h"
#include "qfontenginemultifontconfig_p.h"
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
#include <QtCore/QList>
#include <QtCore/QElapsedTimer>

View File

@ -52,7 +52,7 @@
//
#include <qpa/qplatformfontdatabase.h>
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
QT_BEGIN_NAMESPACE

View File

@ -39,7 +39,7 @@
#include "qfontenginemultifontconfig_p.h"
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
QT_BEGIN_NAMESPACE

View File

@ -11,10 +11,6 @@ darwin {
include($$PWD/mac/coretext.pri)
}
qtConfig(freetype) {
include($$PWD/freetype/freetype.pri)
}
unix {
include($$PWD/genericunix/genericunix.pri)
}

View File

@ -57,7 +57,7 @@
#include <QtFontDatabaseSupport/private/qfontconfigdatabase_p.h>
typedef QFontconfigDatabase QGenericUnixFontDatabase;
#else
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
typedef QFreeTypeFontDatabase QGenericUnixFontDatabase;
#endif //Q_FONTCONFIGDATABASE

View File

@ -13,3 +13,7 @@ else: \
LIBS_PRIVATE += -framework UIKit
CONFIG += watchos_coretext
qtConfig(freetype) {
QMAKE_USE_PRIVATE += freetype
}

View File

@ -57,7 +57,7 @@
#endif
#include <QtCore/QtEndian>
#ifndef QT_NO_FREETYPE
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
#endif
QT_BEGIN_NAMESPACE

View File

@ -40,7 +40,7 @@
#include "qwindowsfontdatabase_ft_p.h"
#include "qwindowsfontdatabase_p.h"
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
#include <ft2build.h>
#include FT_TRUETYPE_TABLES_H

View File

@ -51,7 +51,7 @@
// We mean it.
//
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
#include <QtCore/QSharedPointer>
#include <QtCore/qt_windows.h>

View File

@ -15,6 +15,7 @@ HEADERS += \
qtConfig(freetype) {
SOURCES += $$PWD/qwindowsfontdatabase_ft.cpp
HEADERS += $$PWD/qwindowsfontdatabase_ft_p.h
QMAKE_USE_PRIVATE += freetype
}
qtConfig(directwrite):qtConfig(direct2d) {

View File

@ -39,7 +39,7 @@
#include "qwinrtfontdatabase_p.h"
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>

View File

@ -51,7 +51,7 @@
// We mean it.
//
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
#include <QtCore/QLoggingCategory>
struct IDWriteFontFile;

View File

@ -40,7 +40,7 @@
#ifndef QANDROIDPLATFORMFONTDATABASE_H
#define QANDROIDPLATFORMFONTDATABASE_H
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
QT_BEGIN_NAMESPACE

View File

@ -45,7 +45,7 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
#if defined(Q_OS_WINRT)
# include <QtFontDatabaseSupport/private/qwinrtfontdatabase_p.h>
#elif defined(Q_OS_WIN)
@ -63,7 +63,7 @@
#endif
#if QT_CONFIG(freetype)
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_ft_p.h>
#endif
#if !defined(Q_OS_WIN)

View File

@ -50,7 +50,7 @@
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
#endif
#elif defined(Q_OS_WIN)
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
#ifndef Q_OS_WINRT
#include <QtCore/private/qeventdispatcher_win_p.h>
#else

View File

@ -30,7 +30,7 @@
#ifndef QWASMFONTDATABASE_H
#define QWASMFONTDATABASE_H
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#include <QtGui/private/qfreetypefontdatabase_p.h>
QT_BEGIN_NAMESPACE

View File

@ -207,7 +207,7 @@ qtConfig(gui) {
}
qtConfig(freetype):!qtConfig(system-freetype) {
SUBDIRS += src_3rdparty_freetype
src_platformsupport.depends += src_3rdparty_freetype
src_gui.depends += src_3rdparty_freetype
}
qtConfig(vkgen) {
SUBDIRS += src_tools_qvkgen