From 78eeb6b066113c678fe15531ca10e70964f6b9a4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 11 May 2016 15:10:50 +0300 Subject: QFont::exactMatch() should return false for aliases This is a partial revert of 992f233c in Qt 4 repo. The rest of the change cannot be reverted, since it added public API, but that API might be useful anyway. The patch was wrong, basically. QFont::exactMatch() should not claim that you can get an exact match for a typeface alias. It also introduced some weird inconsistencies: For instance, if the first font the alias resolved to in FontConfig did not exist, then exactMatch() would return false, even if it then resolved to the next one which existed. This caused a test failure on OpenSuse, where the preferred font for "sans" is Arial, which doesn't exist, so Roboto will be used instead. [ChangeLog][QtGui][Important Behavior Changes] QFont::exactMatch() now returns false when the provided typeface is an alias. Task-number: QTBUG-46054 Change-Id: I7532d2879b492544620aa0d1d87dd493a4923af9 Reviewed-by: Simon Hausmann --- src/gui/text/qfont.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/gui/text/qfont.cpp') diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7e18250087..f92e4ab457 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -118,9 +118,6 @@ bool QFontDef::exactMatch(const QFontDef &other) const QFontDatabase::parseFontName(family, this_foundry, this_family); QFontDatabase::parseFontName(other.family, other_foundry, other_family); - this_family = QFontDatabase::resolveFontFamilyAlias(this_family); - other_family = QFontDatabase::resolveFontFamilyAlias(other_family); - return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight -- cgit v1.2.3