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

DirectWrite Font Database: High memory footprint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.3, 6.10.0 Beta3
    • GUI: Font handling
    • None

      In DirectWriteFontFileStream::ReadFileFragment() line 331, accessing  m_fontData.data() duplicates the font data for every font face. 
      This will result in significant memory usage when loading large font files (e.g. loading SourceHanSans-Regular.ttc eats up extra ~150MB private bytes).

      Adding a const qualifier to the m_fontData member should fix this issue:

      class DirectWriteFontFileStream: public IDWriteFontFileStream
      {
      ...
      private:
          const QByteArray m_fontData;
          ULONG m_referenceCount;
      };
      

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

            esabraha Eskil Abrahamsen Blomfeldt
            gpbeta Joshua GPBeta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes