Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108624 Variable fonts support in Qt
  3. QTBUG-117835

Implement support for arbitrary axes values on DirectWrite

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • GUI: Font handling
    • None
    • Windows
    • 7bc6f4ae8 (dev)

    Description

      It's possible to create a font face that represents a specific set of axes values in DirectWrite, using this function in IDWriteFactory6: https://learn.microsoft.com/en-us/windows/win32/api/dwrite_3/nf-dwrite_3-idwritefactory6-createfontfacereference

      This requires some refactoring:
      1. Currently the DirectWrite font database only stores the font face directly. It would have to also store the IDWriteFontFile reference so that it can create new faces for changes values. In order for this to work correctly with named instances, we would have to get the current set of values for the stored face (which may represent an instance) and then merge this with the set of values provided by the user.
      2. With the default font database we can produce the correct font face at the correct time, since this is not cached. But because DirectWrite only knows about our application fonts through GDI, we currently load the font in GDI and then copy it to DirectWrite using CreateFontFaceFromHdc(). With this code, there is no way to get a face for the specified values. So for this code path, we will have to get the IDWriteFontFile refs for the font (if that is even possible) and then create new faces from these.

      For now, #2 is a stretch goal and we focus on solving this for the DirectWrite font database since this is the future API. Loading named instances from variable application fonts is also not supported on GDI database.

      Once it works with DirectWrite we can check if it's easy to support it on GDI and if not, document the way to select DirectWrite better and then work towards making it the default (with some sort of work around for bitmap fonts).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes