Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.8
-
None
Description
Qt currently renders text with the synthetic emboldening when choosing a variable font with non-Regular styles, even if they have real faces for various styles.
Detailed description:
Qt tries to get some FcPattern from FcFontMatch() from FontEngine::FaceId, with FC_FAMILY, FC_FILE, FC_INDEX, and FC_PIXEL_SIZE though, FC_INDEX doesn't affect on scoring in fontconfig. This is because both FC_FILE and FC_INDEX can figures out a unique font enough and no need to "find out" the best font which is almost the purpose of FcFontMatch() function.
As a result, it is similar to find out the best font with FC_FAMILY, FC_FILE, and FC_PIXEL_SIZE. fontconfig then returns a font with Regular style for even non-Regular styles.
After reading Qt's font handling roughly, I wonder if they really need to call FcFontMatch() - assuming they have a complete FcPattern result from FcFontList() though - they just need to call FcFontRenderPrepare() with a FcPattern from FcFontList() to get some rendering-related options.
However, it has to be converted to their own data structure instead of FcPattern. I'd suggest to have weight and width and more properties to store in Qt's font database and add back to FcPattern to query a font by FcFontMatch() instead of FC_INDEX then.