6#include <QtGui/private/qguiapplication_p.h>
7#include <qpa/qplatformscreen.h>
10#include <QtCore/QLibraryInfo>
12#include <QtCore/QtEndian>
18#include FT_TRUETYPE_TABLES_H
31 qWarning(
"QFontDatabase: Cannot find font directory %s.\n"
32 "Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.",
37 static const QString nameFilters[] = {
95 if (
error != FT_Err_Ok) {
99 numFaces =
face->num_faces;
104 if (
face->style_flags & FT_STYLE_FLAG_ITALIC)
107 if (
face->style_flags & FT_STYLE_FLAG_BOLD)
110 bool fixedPitch = (
face->face_flags & FT_FACE_FLAG_FIXED_WIDTH);
113 for (
int i = 0;
i <
face->num_charmaps; ++
i) {
114 FT_CharMap cm =
face->charmaps[
i];
115 if (cm->encoding == FT_ENCODING_ADOBE_CUSTOM
116 || cm->encoding == FT_ENCODING_MS_SYMBOL) {
123 TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(
face, ft_sfnt_os2);
132 quint32(os2->ulCodePageRange1),
138 if (os2->usWeightClass) {
140 }
else if (os2->panose[2]) {
141 int w = os2->panose[2];
162 switch (os2->usWidthClass) {
202 if (applicationFont !=
nullptr) {
213 registerFont(family, styleName,
QString(),
weight, style, stretch,
true,
true, 0, fixedPitch, writingSystems, fontFile);
214 families.append(family);
218 }
while (
index < numFaces);
\inmodule QtCore \reentrant
QString absoluteFilePath() const
Returns an absolute path including the file name.
static QByteArray encodeName(const QString &fileName)
Converts fileName to an 8-bit encoding that you can use in native APIs.
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
static QFontEngineFT * create(const QFontDef &fontDef, FaceId faceId, const QByteArray &fontData=QByteArray())
Stretch
Predefined stretch values that follow the CSS naming convention.
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
Style
This enum describes the different styles of glyphs that are used to display text.
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,...
void populateFontDatabase() override
This function is called once at startup by Qt's internal font database.
static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file, QFontDatabasePrivate::ApplicationFont *applicationFont=nullptr)
void releaseHandle(void *handle) override
Releases the specified font handle.
QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName, QFontDatabasePrivate::ApplicationFont *applicationFont=nullptr) override
Adds an application font described by the font contained supplied fontData or using the font containe...
static QList< QString > fromReadOnlyData(const QString(&t)[N]) noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.
void setSupported(QFontDatabase::WritingSystem, bool supported=true)
Sets or clears support for the specified writingSystem based on the value given by support.
Combined button and popup list for selecting options.
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError * error
FT_Library qt_getFreetype()
FT_Library qt_getFreetype()
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
GLuint GLuint GLfloat weight
GLenum GLsizeiptr const void * fontData
#define qPrintable(string)
QFileInfo fi("c:/temp/foo")
[newstuff]
QList< Properties > properties