Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.7.3, 4.8.1, 5.1.1, 5.2.0
-
None
-
OSX 10.8.5 Win7
Description
This might be two bugs. First, unless QFont is passed an empty string, "", to its constructor, then the TypeWriter and Monospace hints as well as the setFixedPitch(true) method are ignored.
Second, 5.1.1, actually performs worse returning variable width fonts in all but one case.
I've run the following code snippet using the listed Qt versions on OSX 10.8.5 and received the output below.
Expected result: I think every font returned should have been a fixed-width font.
qDebug() << qVersion() << QT_VERSION_STR; { QFont f; f.setStyleHint(QFont::TypeWriter); qDebug("%-15s %-15s %-20s %s", "QFont()", "TypeWriter", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } { QFont f(""); f.setStyleHint(QFont::TypeWriter); qDebug("%-15s %-15s %-20s %s", "QFont(\"\")", "TypeWriter", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } { QFont f; f.setStyleHint(QFont::Monospace); qDebug("%-15s %-15s %-20s %s", "QFont()", "Monospace", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } { QFont f(""); f.setStyleHint(QFont::Monospace); qDebug("%-15s %-15s %-20s %s", "QFont(\"\")", "Monospace", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } { QFont f; f.setFixedPitch(true); qDebug("%-15s %-15s %-20s %s", "QFont()", "setFixedPitch", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } { QFont f(""); f.setFixedPitch(true); qDebug("%-15s %-15s %-20s %s", "QFont(\"\")", "setFixedPitch", qPrintable(QFontInfo(f).family()), QFontInfo(f).fixedPitch() ? "fixed-width" : "variable"); } } // 4.7.3 4.7.3 // QFont() TypeWriter Lucida Grande variable // QFont("") TypeWriter Courier New fixed-width // QFont() Monospace Lucida Grande variable // QFont("") Monospace Helvetica variable // QFont() setFixedPitch Lucida Grande variable // QFont("") setFixedPitch Courier New fixed-width // 4.8.1 4.8.1 // QFont() TypeWriter Lucida Grande variable // QFont("") TypeWriter Courier New fixed-width // QFont() Monospace Lucida Grande variable // QFont("") Monospace Helvetica variable // QFont() setFixedPitch Lucida Grande variable // QFont("") setFixedPitch Courier New fixed-width // 5.1.1 5.1.1 // QFont() TypeWriter Lucida Grande variable // QFont("") TypeWriter Academy Engraved LET variable // QFont() Monospace Lucida Grande variable // QFont("") Monospace Academy Engraved LET variable // QFont() setFixedPitch Lucida Grande variable // QFont("") setFixedPitch Andale Mono fixed-width
Attachments
Issue Links
- relates to
-
QTBUG-987 QFontInfo::fixedPitch() can report false value
- Closed