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
QCoreTextFontDatabaseEngineFactory< T > Class Template Reference

#include <qcoretextfontdatabase_p.h>

+ Inheritance diagram for QCoreTextFontDatabaseEngineFactory< T >:
+ Collaboration diagram for QCoreTextFontDatabaseEngineFactory< T >:

Public Member Functions

QFontEnginefontEngine (const QFontDef &fontDef, void *handle) override
 Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.
 
QFontEnginefontEngine (const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override
 Returns the font engine that will be used to back a QRawFont, based on the given \fontData, pixelSize, and hintingPreference.
 
QFontEnginefontEngine (const QFontDef &fontDef, void *usrPtr)
 Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.
 
QFontEnginefontEngine (const QFontDef &fontDef, void *usrPtr)
 Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.
 
- Public Member Functions inherited from QCoreTextFontDatabase
 QCoreTextFontDatabase ()
 
 ~QCoreTextFontDatabase ()
 
void populateFontDatabase () override
 This function is called once at startup by Qt's internal font database.
 
bool populateFamilyAliases (const QString &missingFamily) override
 
void populateFamily (const QString &familyName) override
 This function is called whenever a lazily populated family, populated through registerFontFamily(), needs full population.
 
void invalidate () override
 This function is called whenever the font database is invalidated.
 
QStringList fallbacksForFamily (const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override
 Returns a list of alternative fonts for the specified family and style and script using the styleHint given.
 
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 contained in the file referenced by fileName.
 
void releaseHandle (void *handle) override
 Releases the specified font handle.
 
bool isPrivateFontFamily (const QString &family) const override
 Returns true if the font family is private.
 
QFont defaultFont () const override
 Returns the default system font.
 
bool fontsAlwaysScalable () const override
 Return true if all fonts are considered scalable when using this font database.
 
QList< int > standardSizes () const override
 Return list of standard font sizes when using this font database.
 
bool supportsVariableApplicationFonts () const override
 Returns true if this font database supports loading named instances from variable application fonts.
 
QFontthemeFont (QPlatformTheme::Font) const
 
- Public Member Functions inherited from QPlatformFontDatabase
virtual ~QPlatformFontDatabase ()
 
virtual QFontEngineMultifontEngineMulti (QFontEngine *fontEngine, QChar::Script script)
 Returns a multi font engine in the specified script to encapsulate fontEngine with the option to fall back to the fonts given by fallbacks if fontEngine does not support a certain character.
 
virtual QString fontDir () const
 Returns the directory containing the fonts used by the database.
 
virtual QString resolveFontFamilyAlias (const QString &family) const
 Resolve alias to actual font family names.
 

Additional Inherited Members

- Static Public Member Functions inherited from QPlatformFontDatabase
static QSupportedWritingSystems writingSystemsFromTrueTypeBits (quint32 unicodeRange[4], quint32 codePageRange[2])
 Helper function that determines the writing systems support by a given unicodeRange and codePageRange.
 
static QSupportedWritingSystems writingSystemsFromOS2Table (const char *os2Table, size_t length)
 Helper function that determines the writing system support based on the contents of the OS/2 table in the font.
 
static void registerFont (const QString &familyname, const QString &stylename, const QString &foundryname, QFont::Weight weight, QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle)
 Registers a font with the given set of attributes describing the font's foundry, family name, style and stretch information, pixel size, and supported writing systems.
 
static void registerFontFamily (const QString &familyName)
 Registers a font family with the font database.
 
static void registerAliasToFontFamily (const QString &familyName, const QString &alias)
 Helper function that register the alias for the familyName.
 
static void repopulateFontDatabase ()
 Requests that the platform font database should be repopulated.
 
static bool isFamilyPopulated (const QString &familyName)
 Helper function that returns true if the font family has already been registered and populated.
 

Detailed Description

template<class T>
class QCoreTextFontDatabaseEngineFactory< T >

Definition at line 75 of file qcoretextfontdatabase_p.h.

Member Function Documentation

◆ fontEngine() [1/4]

template<class T >
QFontEngine * QCoreTextFontDatabaseEngineFactory< T >::fontEngine ( const QByteArray & fontData,
qreal pixelSize,
QFont::HintingPreference hintingPreference )
overridevirtual

Returns the font engine that will be used to back a QRawFont, based on the given \fontData, pixelSize, and hintingPreference.

This function is called by QRawFont, and does not play a part in the normal operations of QFontDatabase.

Reimplemented from QPlatformFontDatabase.

Definition at line 555 of file qcoretextfontdatabase.mm.

◆ fontEngine() [2/4]

template<class T >
QFontEngine * QCoreTextFontDatabaseEngineFactory< T >::fontEngine ( const QFontDef & fontDef,
void * handle )
overridevirtual

Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.

This function is called by QFontDatabase both for system fonts provided by the platform font database, as well as for application fonts added by the application developer.

The handle is the QPlatformFontDatabase specific handle passed when registering the font family via QPlatformFontDatabase::registerFont.

The function is called for both fonts added via a filename as well as fonts added from QByteArray data. Subclasses will need to handle both cases via its platform specific handle.

Reimplemented from QPlatformFontDatabase.

◆ fontEngine() [3/4]

QFontEngine * QCoreTextFontDatabaseEngineFactory< QCoreTextFontEngine >::fontEngine ( const QFontDef & fontDef,
void * handle )
virtual

Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.

This function is called by QFontDatabase both for system fonts provided by the platform font database, as well as for application fonts added by the application developer.

The handle is the QPlatformFontDatabase specific handle passed when registering the font family via QPlatformFontDatabase::registerFont.

The function is called for both fonts added via a filename as well as fonts added from QByteArray data. Subclasses will need to handle both cases via its platform specific handle.

Reimplemented from QPlatformFontDatabase.

Definition at line 478 of file qcoretextfontdatabase.mm.

References QMap< Key, T >::constBegin(), QMap< Key, T >::constEnd(), QCFType< T >::constructFromGet(), font, QMap< Key, T >::isEmpty(), it, QFontDef::pixelSize, qt_transform_from_fontdef(), QMap< Key, T >::size(), tag, and QFontDef::variableAxisValues.

+ Here is the call graph for this function:

◆ fontEngine() [4/4]

QFontEngine * QCoreTextFontDatabaseEngineFactory< QFontEngineFT >::fontEngine ( const QFontDef & fontDef,
void * handle )
virtual

Returns the font engine that can be used to render the font described by the font definition, fontDef, in the specified script.

This function is called by QFontDatabase both for system fonts provided by the platform font database, as well as for application fonts added by the application developer.

The handle is the QPlatformFontDatabase specific handle passed when registering the font family via QPlatformFontDatabase::registerFont.

The function is called for both fonts added via a filename as well as fonts added from QByteArray data. Subclasses will need to handle both cases via its platform specific handle.

Reimplemented from QPlatformFontDatabase.

Definition at line 525 of file qcoretextfontdatabase.mm.

References QFontEngineFT::create(), QFontEngine::FaceId::filename, QFreetypeFace::getFaceIndexByStyleName(), QFontDef::hintingPreference, QFontEngine::FaceId::index, kQtFontDataAttribute, QUrl::path(), QFontDef::pixelSize, Q_ASSERT, url, QFontEngine::FaceId::variableAxes, and QFontDef::variableAxisValues.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: