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

Qt Quick native text rendering doesn't play nice with large font sizes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.1, 5.10.0
    • GUI: Text handling
    • None

    Description

      It appears QSGDefaultGlyphNode and QFontEngineFT's assumptions are not in line when it comes to large font sizes.

      The following reduction causes a stack overflow on any platform using freetype with Qt 5.10

      code
      import QtQuick 2.7

      Text {
      renderType: Text.NativeRendering
      font

      { pixelSize: 372 }

      text: font.pixelSize
      }
      code

      This is because the call to loadGlyph resulting from QFontEngineFT::alphaMapForGlyph bails after considering the metrics are too large to warrant caching, so we end up calling QFontEngine::alphaMapForGlyph, which leads to infinite recursion.
      QFontEngineFT::Glyph is designed around the idea that it is only used in conjunction with caching, so metrics would likely overflow anyway (width and height are a signed char), which means most of the machinery at play isn't really fit for the job.

      I'm not sure how this would be best solved without affecting the wide-range of existing use cases out there, while not adding tons of complexity with yet another very different code path.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            ntg Pierre Rossi
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes