From 400f8a49b8bd9b8303f8770c51d5f080632470a3 Mon Sep 17 00:00:00 2001 From: Li Qiu Date: Fri, 22 Aug 2014 11:20:02 +0300 Subject: [PATCH] Fix font family name mismatch between localized and non-localized version Localized font family names and their aliases are stored in font database. However, fallbacksForFamily gets non-localized family names which results in family name mismatch. Change-Id: Iddf9101e15a0e49c5ba4c049969fc90cb7853443 Task-number: QTBUG-40978 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 86a0bf10663..fe1f915e8fc 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1558,6 +1558,15 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty QtFontStyle::Key styleKey(style); QtFontFamily *f = d->family(familyName); + if (!f) { + for (int i = 0; i < d->count; i++) { + if (d->families[i]->matchesFamilyName(familyName)) { + f = d->families[i]; + f->ensurePopulated(); + break; + } + } + } if (!f) return smoothScalable; for (int j = 0; j < f->count; j++) {