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

wrong font selected after added with QFontDatabase::addApplicationFont (plus exceptions in DWrite!DWriteCreateFactory)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.8.1
    • GUI: Font handling
    • None
    • Windows 10
    • Windows

    Description

      After calling QFontDatabase::addApplicationFontWrongFont with a path to a font file, trying to select the just added font, selects the wrong font if both a regular and a bold font file were added. Plus running the code in the debugger causes exceptions (DWrite!DWriteCreateFactory).

       

      The attached code adds two font files from the file system. One regular ("Noto Sans") and one bold ("Noto Sans Bold"). The font files are attached and the sample code expects them to be located two directories up from the executable.

       

      When you run the sample code, the bold font is used in the place of the regular font, while the resulting bold font is a different (non-bold) font (system default?). See attached screenshot. It also throws exceptions and outputs text when run from the debugger.

      Attachments

        1. DebugOutputQt6.8.1.txt
          1.0 kB
          E Visser
        2. ExceptionLocation1.png
          127 kB
          E Visser
        3. ExceptionLocation3.png
          197 kB
          E Visser
        4. ExceptionLocation7.png
          227 kB
          E Visser
        5. ExceptionQt6.8.1.png
          11 kB
          E Visser
        6. ExceptionStack1.png
          41 kB
          E Visser
        7. ExceptionStack3.png
          86 kB
          E Visser
        8. ExceptionStack7.png
          52 kB
          E Visser
        9. Log_241206.txt
          41 kB
          E Visser
        10. NotoSans-Bold.ttf
          562 kB
          E Visser
        11. NotoSans-Regular.ttf
          556 kB
          E Visser
        12. QFontDatabaseAddApplicationFontWrongFont.cpp
          2 kB
          E Visser
        13. screenshot-1.png
          39 kB
          Eskil Abrahamsen Blomfeldt
        14. ScreenshotQt6.8.1-1.png
          44 kB
          E Visser
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            ev E Visser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes