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

QPainter's drawText method can't paint unicode characters with code values above 65535

XMLWordPrintable

    • Linux/X11, Windows
    • 4a5abfcea (dev)

      Steps to Reproduce

      Run the Wiggle Example (https://doc.qt.io/qt-6/qtwidgets-widgets-wiggly-example.html ) and copy + paste some affected text into the QLineEdit:

      (Fun fact: JIRA crashes if I include those characters directly in this description)

       

      Outcome

      The text renders correctly in the QLineEdit but not in the WigglyWidget.

       

       

      Original Report

      http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=22489
      This Chinese character will be stored using surrogate pairs, QPainter's drawText method can't paint this character, and QTextEdit can't display this character too. In both test, I use a font named "SimSun".
      The same character can be displayed by other programs in my computer.

        1. drawText-failure.png
          7 kB
          Sze Howe Koh
        2. wiggly-mod.png
          28 kB
          Eirik Aavitsland
        For Gerrit Dashboard: QTBUG-28853
        # Subject Branch Project Status CR V

            vgt Eirik Aavitsland
            bobwu paperspace@qq.com
            Votes:
            4 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes