Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsdirectwritefontdatabase_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 QWINDOWSDIRECTWRITEFONTDATABASE_P_H
5#define QWINDOWSDIRECTWRITEFONTDATABASE_P_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 <QtGui/qtguiglobal.h>
19#include <QtGui/private/qtgui-config_p.h>
20
21QT_REQUIRE_CONFIG(directwrite3);
22
24#include <QtCore/qloggingcategory.h>
25
26struct IDWriteFactory;
27struct IDWriteFont;
28struct IDWriteFont1;
29struct IDWriteFontFamily;
30struct IDWriteLocalizedStrings;
31
33
35{
36 Q_DISABLE_COPY_MOVE(QWindowsDirectWriteFontDatabase)
37public:
40
41 void populateFontDatabase() override;
42 void populateFamily(const QString &familyName) override;
43 bool populateFamilyAliases(const QString &missingFamily) override;
44 QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
45 QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
46 QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
47 QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *font = nullptr) override;
48 QFont defaultFont() const override;
49
50 bool isPrivateFontFamily(const QString &family) const override;
51 bool supportsVariableApplicationFonts() const override;
52
53 void registerBitmapFont(const QString &bitmapFont)
54 {
55 m_populatedBitmapFonts.insert(bitmapFont);
56 }
57
58 bool hasPopulatedFont(const QString &fontFamily) const
59 {
60 return m_populatedFonts.contains(fontFamily);
61 }
62
63private:
65 static QString localeString(IDWriteLocalizedStrings *names, wchar_t localeName[]);
66
67 QSupportedWritingSystems supportedWritingSystems(IDWriteFontFace *face) const;
68
69 QHash<QString, IDWriteFontFamily *> m_populatedFonts;
70 QSet<QString> m_populatedBitmapFonts;
71};
72
74
75#endif // QWINDOWSDIRECTWRITEFONTDATABASE_P_H
\inmodule QtCore
Definition qbytearray.h:57
\reentrant
Definition qfont.h:22
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:25
HintingPreference
Definition qfont.h:55
Style
This enum describes the different styles of glyphs that are used to display text.
Definition qfont.h:76
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.
void registerBitmapFont(const QString &bitmapFont)
bool hasPopulatedFont(const QString &fontFamily) const
Font database for Windows.
Windows font engine using Direct Write.
Combined button and popup list for selecting options.
static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
static QString localeString(const QLocaleData *that, QSystemLocale::QueryType type, QLocaleData::DataRange range)
Definition qlocale.cpp:935
GLuint64 GLenum void * handle
GLenum face
GLenum GLsizeiptr const void * fontData
GLuint GLuint * names
#define QT_REQUIRE_CONFIG(feature)
double qreal
Definition qtypes.h:187