Qt 6.x
The Qt SDK
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 IDWriteFontFamily;
29struct IDWriteLocalizedStrings;
30
32
34{
35 Q_DISABLE_COPY_MOVE(QWindowsDirectWriteFontDatabase)
36public:
39
40 void populateFontDatabase() override;
41 void populateFamily(const QString &familyName) override;
42 QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
43 QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
45 void releaseHandle(void *handle) override;
46 QFont defaultFont() const override;
47
48 bool fontsAlwaysScalable() const override;
49 bool isPrivateFontFamily(const QString &family) const override;
50
51private:
52 static QString localeString(IDWriteLocalizedStrings *names, wchar_t localeName[]);
53
55};
56
58
59#endif // QWINDOWSDIRECTWRITEFONTDATABASE_P_H
\inmodule QtCore
Definition qbytearray.h:57
Script
Definition qchar.h:144
\reentrant
Definition qfont.h:20
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:23
Style
This enum describes the different styles of glyphs that are used to display text.
Definition qfont.h:73
\inmodule QtCore
Definition qhash.h:818
virtual QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *font=nullptr)
Adds an application font described by the font contained supplied fontData or using the font containe...
virtual QFont defaultFont() const
Returns the default system font.
virtual bool fontsAlwaysScalable() const
Return true if all fonts are considered scalable when using this font database.
virtual void releaseHandle(void *handle)
Releases the specified font handle.
virtual QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
Returns a list of alternative fonts for the specified family and style and script using the styleHint...
virtual void populateFamily(const QString &familyName)
This function is called whenever a lazily populated family, populated through registerFontFamily(),...
virtual bool isPrivateFontFamily(const QString &family) const
Returns true if the font family is private.
virtual void populateFontDatabase()
This function is called once at startup by Qt's internal font database.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QFontEngine * fontEngine(const QFontDef &fontDef, void *handle) override
Returns the font engine that can be used to render the font described by the font definition,...
Combined button and popup list for selecting options.
static QString localeString(const QLocaleData *that, QSystemLocale::QueryType type, QLocaleData::DataRange range)
Definition qlocale.cpp:912
GLuint64 GLenum void * handle
GLenum GLsizeiptr const void * fontData
GLuint GLuint * names
#define QT_REQUIRE_CONFIG(feature)