Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.0 Beta
-
None
Description
Example: AlrightSans-Bold
I verified that if we try to load AlrightSans with a weight of 81 or 75, our code will choose alrightsans-bold-v3.otf, and then set embolden to true due to these lines:
if ((fontDef.weight >= QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face)) embolden = true;
Likewise for a weight of 87, it will load alrightsans-ultra-v3.otf, and that one also is not set to bold, so it will be emboldened.
Then I verified that if I open these two files in fontforge, go to Element | Font Info, then the OS/2 tab, and change Style Map from None to Bold, then re-generate the OTF file (File | Generate Fonts), face->style_flags will not be zero anymore, and this font will no longer be emboldened.
This seems naive, because there is not just one bold font in this family of 6 fonts: there are instead ultra, black, bold, medium, regular, and thin. Qt is not doing a good job of choosing the right one according to weight: that's one problem. But this bug is about the fact that it emboldens the bold ones even more.
The otf files are not attached because this is a commercial font, but just ask if you need a copy to test.
But I don't understand of all the places that the weight can be specified in various font metadata tables (I found about 5 of them while poking around in FontForge), which ones freetype can look at, and which ones Qt should therefore be using in order to match up the requested weight with the right font file.
Attachments
Issue Links
- duplicates
-
QTBUG-80866 Freetype: font can be embolden twice
- Closed
- relates to
-
QTBUG-30851 Impossible to use different flavours of a font in the same project without changing the font's "Font Family"
- Closed
-
QTBUG-46043 QFontDatabase makes bad font weight choices for Alright Sans family
- Closed
-
QTBUG-42248 Switch the QFont::Weight scale to OpenType
- Closed