Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsfontdatabase.cpp File Reference
#include "qwindowsfontdatabase_p.h"
#include "qwindowsfontdatabase_ft_p.h"
#include "qwindowsfontengine_p.h"
#include <QtCore/qt_windows.h>
#include <QtGui/QFont>
#include <QtGui/QGuiApplication>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qtgui-config_p.h>
#include <QtCore/qmath.h>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QtEndian>
#include <QtCore/QStandardPaths>
#include <QtCore/private/qduplicatetracker_p.h>
#include <QtCore/private/qwinregistry_p.h>
#include <wchar.h>
+ Include dependency graph for qwindowsfontdatabase.cpp:

Go to the source code of this file.

Macros

#define MAKE_TAG(ch1, ch2, ch3, ch4)
 

Functions

QDebug operator<< (QDebug d, const QFontDef &def)
 
QDebug operator<< (QDebug d, const LOGFONT &lf)
 
static QFontDatabase::WritingSystem writingSystemFromCharSet (uchar charSet)
 
bool qt_localizedName (const QString &name)
 
QString qt_getEnglishName (const QString &familyName, bool includeStyle)
 
QFontNames qt_getCanonicalFontNames (const LOGFONT &lf)
 
static QCharcreateFontFile (const QString &faceName)
 
static bool addFontToDatabase (QString familyName, QString styleName, const LOGFONT &logFont, const TEXTMETRIC *textmetric, const FONTSIGNATURE *signature, int type, StoreFontPayload *sfp)
 
static int QT_WIN_CALLBACK storeFont (const LOGFONT *logFont, const TEXTMETRIC *textmetric, DWORD type, LPARAM lparam)
 
static int QT_WIN_CALLBACK populateFontFamilies (const LOGFONT *logFont, const TEXTMETRIC *textmetric, DWORD, LPARAM)
 
static QList< quint32getTrueTypeFontOffsets (const uchar *fontData)
 
static void getFontTable (const uchar *fileBegin, const uchar *data, quint32 tag, const uchar **table, quint32 *length)
 
static void getFamiliesAndSignatures (const QByteArray &fontData, QList< QFontNames > *families, QList< FONTSIGNATURE > *signatures, QList< QFontValues > *values)
 

Macro Definition Documentation

◆ MAKE_TAG

#define MAKE_TAG (   ch1,
  ch2,
  ch3,
  ch4 
)
Value:
(\
(((quint32)(ch4)) << 24) | \
(((quint32)(ch3)) << 16) | \
(((quint32)(ch2)) << 8) | \
((quint32)(ch1)) \
)
unsigned int quint32
Definition qtypes.h:45
out<< "Qt"<< "rocks!";----Qt------rocks!--QTextStream in(file);QChar ch1, ch2, ch3;in > ch1 ch2 ch3

Definition at line 197 of file qwindowsfontdatabase.cpp.

Function Documentation

◆ addFontToDatabase()

static bool addFontToDatabase ( QString  familyName,
QString  styleName,
const LOGFONT &  logFont,
const TEXTMETRIC *  textmetric,
const FONTSIGNATURE *  signature,
int  type,
StoreFontPayload *  sfp 
)
static

◆ createFontFile()

static QChar * createFontFile ( const QString faceName)
static

Definition at line 446 of file qwindowsfontdatabase.cpp.

References QString::data(), QString::isEmpty(), QString::length(), and qMin().

Referenced by addFontToDatabase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFamiliesAndSignatures()

static void getFamiliesAndSignatures ( const QByteArray fontData,
QList< QFontNames > *  families,
QList< FONTSIGNATURE > *  signatures,
QList< QFontValues > *  values 
)
static

Definition at line 907 of file qwindowsfontdatabase.cpp.

References QList< T >::append(), font, getFontTable(), getTrueTypeFontOffsets(), i, QFontValues::isItalic, QFontValues::isOverstruck, QFontValues::isUnderlined, MAKE_TAG, qt_getCanonicalFontNames(), and QFontValues::weight.

Referenced by QWindowsFontDatabase::addApplicationFont().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFontTable()

static void getFontTable ( const uchar fileBegin,
const uchar data,
quint32  tag,
const uchar **  table,
quint32 length 
)
static

Definition at line 891 of file qwindowsfontdatabase.cpp.

References i, and tag.

Referenced by getFamiliesAndSignatures().

+ Here is the caller graph for this function:

◆ getTrueTypeFontOffsets()

static QList< quint32 > getTrueTypeFontOffsets ( const uchar fontData)
static

Definition at line 871 of file qwindowsfontdatabase.cpp.

References i, and MAKE_TAG.

Referenced by getFamiliesAndSignatures().

+ Here is the caller graph for this function:

◆ operator<<() [1/2]

QDebug operator<< ( QDebug  d,
const LOGFONT &  lf 
)

Definition at line 146 of file qwindowsfontdatabase.cpp.

References d, and QWindowsFontDatabase::debugFormat().

+ Here is the call graph for this function:

◆ operator<<() [2/2]

QDebug operator<< ( QDebug  d,
const QFontDef def 
)

Definition at line 125 of file qwindowsfontdatabase.cpp.

References d, QFontDef::families, QFontDef::hintingPreference, QString::isEmpty(), QFontDef::pixelSize, QFontDef::pointSize, QFontDef::stretch, QFontDef::styleHint, QFontDef::styleName, and QFontDef::weight.

+ Here is the call graph for this function:

◆ populateFontFamilies()

static int QT_WIN_CALLBACK populateFontFamilies ( const LOGFONT *  logFont,
const TEXTMETRIC *  textmetric,
DWORD  ,
LPARAM   
)
static

Definition at line 658 of file qwindowsfontdatabase.cpp.

References QString::fromWCharArray(), QString::isEmpty(), qt_getEnglishName(), qt_localizedName(), QPlatformFontDatabase::registerAliasToFontFamily(), and QPlatformFontDatabase::registerFontFamily().

Referenced by QWindowsFontDatabaseFT::populateFontDatabase(), and QWindowsFontDatabase::populateFontDatabase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_getCanonicalFontNames()

QFontNames qt_getCanonicalFontNames ( const LOGFONT &  lf)

Definition at line 415 of file qwindowsfontdatabase.cpp.

References MAKE_TAG, and qt_getCanonicalFontNames().

Referenced by addFontToDatabase(), addFontToDatabase(), getFamiliesAndSignatures(), qt_getCanonicalFontNames(), and qt_getEnglishName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_getEnglishName()

QString qt_getEnglishName ( const QString familyName,
bool  includeStyle 
)

Definition at line 360 of file qwindowsfontdatabase.cpp.

References error, MAKE_TAG, qt_getCanonicalFontNames(), QString::size(), QString::toWCharArray(), and QString::truncate().

Referenced by addFontToDatabase(), populateFontFamilies(), and populateFontFamilies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_localizedName()

bool qt_localizedName ( const QString name)

Definition at line 204 of file qwindowsfontdatabase.cpp.

References i, and QChar::unicode().

Referenced by addFontToDatabase(), addFontToDatabase(), populateFontFamilies(), and populateFontFamilies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeFont()

static int QT_WIN_CALLBACK storeFont ( const LOGFONT *  logFont,
const TEXTMETRIC *  textmetric,
DWORD  type,
LPARAM  lparam 
)
static

Definition at line 599 of file qwindowsfontdatabase.cpp.

References addFontToDatabase(), QString::fromWCharArray(), and Q_ASSERT.

Referenced by QWindowsFontDatabaseFT::populateFamily(), and QWindowsFontDatabase::populateFamily().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writingSystemFromCharSet()

static QFontDatabase::WritingSystem writingSystemFromCharSet ( uchar  charSet)
inlinestatic

Definition at line 156 of file qwindowsfontdatabase.cpp.

References QFontDatabase::Any, QFontDatabase::Arabic, QFontDatabase::Cyrillic, QFontDatabase::Greek, QFontDatabase::Hebrew, QFontDatabase::Japanese, QFontDatabase::Korean, QFontDatabase::Latin, QFontDatabase::SimplifiedChinese, QFontDatabase::Symbol, QFontDatabase::Thai, QFontDatabase::TraditionalChinese, and QFontDatabase::Vietnamese.

Referenced by addFontToDatabase().

+ Here is the caller graph for this function: