Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.8.3
-
None
-
Windows 10, FreeType or GDI font engine
Description
Selecting the "Noto Sans" font by its name and then setting its hinting preference to 'QFont::PreferFullHinting' results in a different weight of the font.
This only seems to happen if the font has a substitute and the font engine is either FreeType or GDI (not the native engine).
This problem was not present in Qt 6.8.2, but appears in Qt 6.8.3.
To reproduce the problem, execute the attached code under Qt 6.8.3 (Windows 10, after changing the path constant in the code to where the attached fonts are stored).
Attached is a screenshot that shows the second line using a condensed font, although the font name is the same as for the first line.
The only difference is that the second line executed the 'QFont::setHintingPreference(QFont::PreferFullHinting)' method.
Some observations:
- the problem was not present in Qt 6.8.2.
- the problem disappears if the 'native' font engine is used.
- the problem disappears if the "Noto Sans CJK JP" font is not set as a substitute for "Noto Sans".
- the problem disappears if the 'QFont::setHintingPreference(QFont::PreferFullHinting)' method is not called on the second font.
- the incorrect font looks like the "Noto Sans Condensed" font (which I have installed on my system, but is not explicitly added as the "Noto Sans" and "Noto Sans CJK JP" fonts are).
This might be related toQTBUG-131902. However, the used "Noto Sans" and "Noto Sans CJK JP" fonts are the correct ones per Eskil Abrahamsen Blomfeldt's comment in theQTBUG-131902bug report.
Attached screenshots:
- using Qt 6.8.2 and FreeType font engine (correct)
- using Qt 6.8.3 and FreeType font engine (incorrect, same result with GDI font engine)
- using Qt 6.8.3 and native font engine (correct)