Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.12.1
-
macOS / Windows 10
Description
I import different types of the font "Helvetica Neue":
// load fonts from resources int fontId0 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Regular.ttf"); int fontId1 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-CondensedBlack.ttf"); int fontId2 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Light.ttf"); int fontId3 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Thin.ttf"); int fontId4 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-UltraLight.ttf");
In order to use e.g. "Helvetica Neue UltraLight" under macOS I have to set the font.styleName property to "UltraLight":
font.styleName: "UltraLight"
The same code doesn't work on Windows 10.
To use the same font on Windows 10 the font.weight property must be set to "Font.ExtraLight" (this in return is not working on macOS):
font.weight: Font.ExtraLight
Attachments
Issue Links
- duplicates
-
QTBUG-69250 Qml font.styleName not working on windows
- Reported
- is required for
-
QTBUG-74860 Umbrella task for font selection issues
- In Progress
- relates to
-
QTBUG-53260 fonts.weight property doesn't work with fonts loaded by Fontloader
- Reported
-
QTBUG-70220 Windows and macOS do not map font weight correctly for Montserrat variants
- Reported
-
QTBUG-31305 styleName of QRawFont and QFont is always empty
- Reported
-
QTBUG-39184 QFontInfo::styleName() does not return actual style name of font
- Reported
-
QTBUG-51335 Font style matching is inconsistent
- Reported
-
QTBUG-46043 QFontDatabase makes bad font weight choices for Alright Sans family
- Closed
- resulted from
-
QTBUG-53458 Matching by styleName on sub-family doesn't work on Windows
- Closed
-
QTBUG-37754 Expose QFont::styleName() to Qt Quick
- Closed