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
qwindowsfontdatabase.cpp File Reference

(e7ddd490cf44ecd1c59b3798294ed2812fc5a940)

#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/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 <mutex>
+ Include dependency graph for qwindowsfontdatabase.cpp:

Go to the source code of this file.

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 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, const uchar *fileEndSentinel)
 
static void getFontTable (const uchar *fileBegin, const uchar *fileEndSentinel, 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)
 

Function Documentation

◆ addFontToDatabase()

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

◆ getFamiliesAndSignatures()

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

Definition at line 926 of file qwindowsfontdatabase.cpp.

References font, getFontTable(), getTrueTypeFontOffsets(), i, qFromBigEndian(), 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 * fileEndSentinel,
const uchar * data,
quint32 tag,
const uchar ** table,
quint32 * length )
static

Definition at line 893 of file qwindowsfontdatabase.cpp.

References i, qCWarning, and tag.

Referenced by getFamiliesAndSignatures().

+ Here is the caller graph for this function:

◆ getTrueTypeFontOffsets()

static QList< quint32 > getTrueTypeFontOffsets ( const uchar * fontData,
const uchar * fileEndSentinel )
static

Definition at line 856 of file qwindowsfontdatabase.cpp.

References i, qCWarning, and qFromBigEndian().

Referenced by getFamiliesAndSignatures().

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

◆ operator<<() [1/2]

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

Definition at line 147 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 126 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 638 of file qwindowsfontdatabase.cpp.

References QString::fromWCharArray(), 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 405 of file qwindowsfontdatabase.cpp.

References qFromBigEndian(), 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 350 of file qwindowsfontdatabase.cpp.

References error, qFromBigEndian(), 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 194 of file qwindowsfontdatabase.cpp.

References i.

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

+ 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 579 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 157 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: