16 #ifndef QGSFONTUTILS_H
17 #define QGSFONTUTILS_H
21 #include <QDomElement>
23 #include "qgis_core.h"
40 static bool fontMatchOnSystem(
const QFont &f );
48 static bool fontFamilyOnSystem(
const QString &family );
57 static bool fontFamilyHasStyle(
const QString &family,
const QString &style );
66 static bool fontFamilyMatchOnSystem(
const QString &family, QString *chosen =
nullptr,
bool *match =
nullptr );
76 static bool updateFontViaStyle( QFont &f,
const QString &fontstyle,
bool fallback =
false );
82 static QString standardTestFontFamily();
91 static bool loadStandardTestFonts(
const QStringList &loadstyles );
100 static QFont getStandardTestFont(
const QString &style =
"Roman",
int pointsize = 12 );
111 static QDomElement toXmlElement(
const QFont &font, QDomDocument &document,
const QString &elementName );
123 static bool setFromXmlElement( QFont &font,
const QDomElement &element );
136 static bool setFromXmlChildNode( QFont &font,
const QDomElement &element,
const QString &childNode );
144 static QMimeData *toMimeData(
const QFont &font )
SIP_FACTORY;
152 static QFont fromMimeData(
const QMimeData *data,
bool *ok
SIP_OUT =
nullptr );
161 static QString translateNamedStyle(
const QString &namedStyle );
170 static QString untranslateNamedStyle(
const QString &namedStyle );
182 static QString asCSS(
const QFont &font,
double pointToPixelMultiplier = 1.0 );
189 static void addRecentFontFamily(
const QString &family );
196 static QStringList recentFontFamilies();