Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112136

Unable to pick up styles properly from Variable fonts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.8
    • GUI: Font handling
    • None
    • Linux/Wayland, Linux/X11

    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.

      Attachments

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            tagoh Akira TAGOH
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: