Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfreetypefontdatabase_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QFREETYPEFONTDATABASE_H
5#define QFREETYPEFONTDATABASE_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 <QtCore/QByteArray>
20#include <QtCore/QString>
21#include <QtCore/private/qglobal_p.h>
22
23QT_BEGIN_NAMESPACE
24
25struct FontFile
26{
27 QString fileName;
28 int indexValue;
29 int instanceIndex = -1;
30
31 // Note: The data may be implicitly shared throughout the
32 // font database and platform font database, so be careful
33 // to never detach when accessing this member!
34 const QByteArray data;
35};
36
37class Q_GUI_EXPORT QFreeTypeFontDatabase : public QPlatformFontDatabase
38{
39public:
40 void populateFontDatabase() override;
41 QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
42 QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
43 QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *applicationFont = nullptr) override;
44 void releaseHandle(void *handle) override;
45 bool supportsVariableApplicationFonts() const override;
46 bool supportsColrv0Fonts() const override;
47
48 static void addNamedInstancesForFace(void *face, int faceIndex,
49 const QString &family, const QString &styleName,
50 QFont::Weight weight, QFont::Stretch stretch,
51 QFont::Style style, bool fixedPitch, bool isColor,
52 const QSupportedWritingSystems &writingSystems,
53 const QByteArray &fileName, const QByteArray &fontData);
54
55 static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file, QFontDatabasePrivate::ApplicationFont *applicationFont = nullptr);
56};
57
58QT_END_NAMESPACE
59
60#endif // QFREETYPEFONTDATABASE_H
FT_Library qt_getFreetype()