The QPlatformFontDatabase makes it possible to customize how fonts are picked up, and and how they are rendered More...
#include <QPlatformFontDatabase>
virtual QStringList | addApplicationFont ( const QByteArray & fontData, const QString & fileName ) |
virtual QStringList | fallbacksForFamily ( const QString family, const QFont::Style & style, const QFont::StyleHint & styleHint, const QUnicodeTables::Script & script ) const |
virtual QString | fontDir () const |
virtual QFontEngine * | fontEngine ( const QFontDef & fontDef, QUnicodeTables::Script script, void * handle ) |
virtual QFontEngine * | fontEngine ( const QByteArray & fontData, qreal pixelSize, QFont::HintingPreference hintingPreference ) |
virtual void | populateFontDatabase () |
virtual void | releaseHandle ( void * handle ) |
void | registerFont ( const QString & familyname, const QString & foundryname, QFont::Weight weight, QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, const QSupportedWritingSystems & writingSystems, void * handle ) |
void | registerQPF2Font ( const QByteArray & dataArray, void * handle ) |
The QPlatformFontDatabase makes it possible to customize how fonts are picked up, and and how they are rendered
QPlatformFontDatabase is the superclass which is intended to let platform implementations use native font handling.
Qt has its internal fontdatabase which it uses to pick up available fonts. To be able to populate this database subclass this class, and reimplement populateFontDatabase().
Use the function registerFont to populate the internal fontdatabase.
Sometimes a specified font does not have the required glyphs, then the fallbackForFamily function is called.
See also QSupportedWritingSystems.
Adds an application font. Returns a list of family names, or an empty list if the font could not be added
This function is called once at startup by Qts internal fontdatabase. Reimplement this function in a subclass for a convenient place to initialise the internal fontdatabase.
The default implementation looks in the fontDir() location and registers all qpf2 fonts.