16#ifndef QGSFONTMANAGER_H
17#define QGSFONTMANAGER_H
24#include <QReadWriteLock>
73 QMap< QString, QString > fontFamilyReplacements()
const;
92 void addFontFamilyReplacement(
const QString &original,
const QString &replacement );
111 void setFontFamilyReplacements(
const QMap< QString, QString> &replacements );
119 QString processFontFamilyName(
const QString &name )
const;
149 bool tryToDownloadFontFamily( const QString &family, QString &matchedFamily
SIP_OUT );
156 void enableFontDownloadsForSession();
168 QString urlForFontDownload( const QString &family, QString &matchedFamily
SIP_OUT ) const;
181 void downloadAndInstallFont( const QUrl &url, const QString &identifier = QString() );
197 bool installFontsFromData( const QByteArray &data, QString &errorMessage
SIP_OUT, QStringList &families
SIP_OUT, QString &licenseDetails
SIP_OUT, const QString &filename = QString() );
208 void addUserFontDirectory( const QString &directory );
215 QMap< QString, QStringList > userFontToFamilyMap() const;
220 bool removeUserFont( const QString &path );
234 void fontDownloaded( const QStringList &families, const QString &licenseDetails );
242 void fontDownloadErrorOccurred( const QUrl &url, const QString &identifier, const QString &error );
246 QMap< QString, QString > mFamilyReplacements;
247 QMap< QString, QString > mLowerCaseFamilyReplacements;
248 QMap< QString, QStringList > mUserFontToFamilyMap;
249 QMap< QString,
int > mUserFontToIdMap;
250 mutable QReadWriteLock mReplacementLock;
251 QStringList mUserFontDirectories;
253 bool mEnableFontDownloads = false;
254 QMap< QString, QString > mPendingFontDownloads;
255 QMap< QString, QString > mDeferredFontDownloads;
257 void storeFamilyReplacements();
258 void installFontsFromDirectory( const QString &dir );
Manages available fonts and font installation for a QGIS instance.
static const QgsSettingsEntryStringList * settingsFontFamilyReplacements
Settings entry for font family replacements.
static const QgsSettingsEntryBool * settingsDownloadMissingFonts
Settings entry for font family replacements.
A boolean settings entry.
A string list settings entry.