Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.2.3, 6.4.0
-
None
-
macOS 12.2
-
-
af875e88f4 (qt/qtbase/dev) 68c17c6fec (qt/qtbase/6.3) 714bb09d55 (qt/qtbase/6.2) 714bb09d55 (qt/tqtc-qtbase/6.2) 68c17c6fec (qt/tqtc-qtbase/6.3) af875e88f4 (qt/tqtc-qtbase/dev)
Description
When a single font file contains multiple font faces (e.g. Regular, Light, Medium, etc.), the FreeType font backend fails to select them on macOS.
For example when requesting the “Light” variant of the macOS system font “Avenir” (/System/Library/Fonts/Avenir.ttc), Qt renders the “Book” variant instead of the “Light” variant.
Reproduction (run with argument -platform cocoa:fontengine=freetype):
#include <QGuiApplication> #include <QFont> #include <QFontInfo> #include <QDebug> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QFont font("Avenir"); font.setStyleName("Light"); font.setPixelSize(12); QFontInfo info(font); qDebug() << info.family() << info.styleName(); }
Actual output:
qt.qpa.fonts: Populating font family aliases took 92 ms. Replace uses of missing font family "Avenir" with one that exists to avoid this cost. "Avenir" "Book"
Expected output:
"Avenir" "Light"
Attachments
Issue Links
- is required for
-
QTBUG-100681 FreeType font backend fails to load variable font variations
-
- Reported
-
For Gerrit Dashboard: QTBUG-100666 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
395068,2 | FreeType: Load multiple font faces from the same file on macOS | dev | qt/qtbase | Status: MERGED | +2 | 0 |
402226,2 | FreeType: Load multiple font faces from the same file on macOS | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
402227,2 | FreeType: Load multiple font faces from the same file on macOS | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |