| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QFONTCONFIGDATABASE_H |
| 5 | #define QFONTCONFIGDATABASE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <qpa/qplatformfontdatabase.h> |
| 19 | #include <QtGui/private/qfreetypefontdatabase_p.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class QFontEngineFT; |
| 24 | |
| 25 | class Q_GUI_EXPORT QFontconfigDatabase : public QFreeTypeFontDatabase |
| 26 | { |
| 27 | public: |
| 28 | ~QFontconfigDatabase() override; |
| 29 | void populateFontDatabase() override; |
| 30 | void invalidate() override; |
| 31 | bool supportsVariableApplicationFonts() const override; |
| 32 | QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override; |
| 33 | QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; |
| 34 | QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; |
| 35 | QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override; |
| 36 | QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *applicationFont = nullptr) override; |
| 37 | QString resolveFontFamilyAlias(const QString &family) const override; |
| 38 | QFont defaultFont() const override; |
| 39 | |
| 40 | private: |
| 41 | void setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const; |
| 42 | }; |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // QFONTCONFIGDATABASE_H |
| 47 | |