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

Qt does not seem to request the right font properties to fontconfig

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.13, 6.5
    • GUI: Font handling
    • None
    • Linux/X11

    Description

      If I have a font file that only offers a regular version of a font, and inside an application I set that font in bold, Qt doesn't request the bold version to fontconfig but only the regular one.

      This can be seen by exporting FC_DEBUG=4 (or 1, or 2) and checking the handling of the request by fontconfig. The initial request (for a bold font in the application) is just:

      FcConfigSubstitute Pattern has 6 elts (size 16)
              family: "Open Sans"(s)
              pixelsize: 19(f)(s)
              file: "/home/peppe/.fonts/OpenSans-Regular.ttf"(s)
              index: 0(i)(s)
              lang: "it"(w)
              prgname: "test"(s)
      

      This blocks a user from having fontconfig rules that for instance may provide another font family / file in case someone asks for Open Sans in bold.

      On the other hand, if a bold font file is then installed, the request then points directly to that bold file:

      FcConfigSubstitute Pattern has 6 elts (size 16)
              family: "Open Sans"(s)
              pixelsize: 19(f)(s)
              file: "/home/peppe/.fonts/OpenSans/OpenSans-Bold.ttf"(s)
              index: 0(i)(s)
              lang: "it"(w)
              prgname: "test"(s)
      

      But once more there's no weight specified here.

      Attachments

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: