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. ScreenshotQt6.8.1-1.png
          ScreenshotQt6.8.1-1.png
          44 kB
        2. screenshot-1.png
          screenshot-1.png
          39 kB
        3. QFontDatabaseAddApplicationFontWrongFont.cpp
          2 kB
        4. NotoSans-Regular.ttf
          556 kB
        5. NotoSans-Bold.ttf
          562 kB
        6. Log_241206.txt
          41 kB
        7. ExceptionStack7.png
          ExceptionStack7.png
          52 kB
        8. ExceptionStack3.png
          ExceptionStack3.png
          86 kB
        9. ExceptionStack1.png
          ExceptionStack1.png
          41 kB
        10. ExceptionQt6.8.1.png
          ExceptionQt6.8.1.png
          11 kB
        11. ExceptionLocation7.png
          ExceptionLocation7.png
          227 kB
        12. ExceptionLocation3.png
          ExceptionLocation3.png
          197 kB
        13. ExceptionLocation1.png
          ExceptionLocation1.png
          127 kB
        14. DebugOutputQt6.8.1.txt
          1.0 kB
        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