diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 3762f39..4e667a4 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -2239,6 +2239,16 @@ int QFontDatabase::weight(const QString &family, } +/*! \internal */ +bool QFontDatabase::hasFamily(const QString &family) const +{ + QString parsedFamily, foundry; + parseFontName(family, foundry, parsedFamily); + const QString familyAlias = resolveFontFamilyAlias(parsedFamily); + return families().contains(familyAlias, Qt::CaseInsensitive); +} + + /*! Returns the names the \a writingSystem (e.g. for displaying to the user in a dialog). diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h index d3463a0..b1f370e 100644 --- a/src/gui/text/qfontdatabase.h +++ b/src/gui/text/qfontdatabase.h @@ -138,6 +138,8 @@ public: bool bold(const QString &family, const QString &style) const; int weight(const QString &family, const QString &style) const; + bool hasFamily(const QString &family) const; + static QString writingSystemName(WritingSystem writingSystem); static QString writingSystemSample(WritingSystem writingSystem); |