QFontDatabase: Make match/bestFoundry/load(Single)Engine part of QFontDatabasePrivate

Makes it clearer where and how they are used, and to set breakpoints on them.

Change-Id: Id2aaeb51ff80676ad3316d29e23661b2cad79478
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
Tor Arne Vestbø 2022-03-25 11:59:21 +01:00
parent 04837c1687
commit 24f242a2f3
2 changed files with 29 additions and 15 deletions

View File

@ -717,8 +717,7 @@ QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFo
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt);
static
QFontEngine *loadSingleEngine(int script,
QFontEngine *QFontDatabasePrivate::loadSingleEngine(int script,
const QFontDef &request,
QtFontFamily *family, QtFontFoundry *foundry,
QtFontStyle *style, QtFontSize *size)
@ -798,8 +797,7 @@ QFontEngine *loadSingleEngine(int script,
return engine;
}
static
QFontEngine *loadEngine(int script, const QFontDef &request,
QFontEngine *QFontDatabasePrivate::loadEngine(int script, const QFontDef &request,
QtFontFamily *family, QtFontFoundry *foundry,
QtFontStyle *style, QtFontSize *size)
{
@ -890,11 +888,10 @@ static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &st
}
static
unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
unsigned int QFontDatabasePrivate::bestFoundry(int script, unsigned int score, int styleStrategy,
const QtFontFamily *family, const QString &foundry_name,
QtFontStyle::Key styleKey, int pixelSize, char pitch,
QtFontDesc *desc, const QString &styleName = QString())
QtFontDesc *desc, const QString &styleName)
{
Q_UNUSED(script);
Q_UNUSED(pitch);
@ -1037,13 +1034,9 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
Tries to find the best match for a given request and family/foundry
*/
static int match(int script,
const QFontDef &request,
const QString &family_name,
const QString &foundry_name,
QtFontDesc *desc,
const QList<int> &blacklistedFamilies,
unsigned int *resultingScore = nullptr)
int QFontDatabasePrivate::match(int script, const QFontDef &request, const QString &family_name,
const QString &foundry_name, QtFontDesc *desc, const QList<int> &blacklistedFamilies,
unsigned int *resultingScore)
{
int result = -1;
@ -1055,7 +1048,7 @@ static int match(int script,
char pitch = request.ignorePitch ? '*' : request.fixedPitch ? 'm' : 'p';
qCDebug(lcFontMatch, "QFontDatabase::match\n"
qCDebug(lcFontMatch, "QFontDatabasePrivate::match\n"
" request:\n"
" family: %s [%s], script: %d\n"
" styleName: %s\n"

View File

@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
struct QtFontDesc;
struct QtFontFallbacksCacheKey
{
QString family;
@ -267,6 +269,25 @@ public:
static QFontDatabasePrivate *ensureFontDatabase();
void invalidate();
private:
static int match(int script, const QFontDef &request, const QString &family_name,
const QString &foundry_name, QtFontDesc *desc, const QList<int> &blacklistedFamilies,
unsigned int *resultingScore = nullptr);
static unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
const QtFontFamily *family, const QString &foundry_name,
QtFontStyle::Key styleKey, int pixelSize, char pitch,
QtFontDesc *desc, const QString &styleName = QString());
static QFontEngine *loadSingleEngine(int script, const QFontDef &request,
QtFontFamily *family, QtFontFoundry *foundry,
QtFontStyle *style, QtFontSize *size);
static QFontEngine *loadEngine(int script, const QFontDef &request,
QtFontFamily *family, QtFontFoundry *foundry,
QtFontStyle *style, QtFontSize *size);
};
Q_DECLARE_TYPEINFO(QFontDatabasePrivate::ApplicationFont, Q_RELOCATABLE_TYPE);