Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2093

Unicode 32 fonts do not render properly, shows garbage icon

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.15.6
    • PySide
    • None
    • Windows

    Description

      This is a regression on the windows build of PySide2, this issue does not happen on 5.13.2, nor does it happen on PyQt5, nor does it happen on C++ Qt, nor Linux.

       

      If you try to use a unicode character greater than UTF-16, it will be truncated and it will not render properly. materialdesignicons5-webfont.ttfHere is the font I am using in this simple example.

      from PySide2 import QtWidgets, QtGui
      
      class Window(QtWidgets.QWidget):
          def __init__(self):
              super().__init__()
              self.mainLayout = QtWidgets.QVBoxLayout()
              self.setLayout(self.mainLayout)
              font = 'materialdesignicons5-webfont.ttf'
              id = QtGui.QFontDatabase.addApplicationFont(font)
              code = r'0xf01c9'
              code = chr(int(code, 16))
              self.label = QtWidgets.QLabel(code)
              self.mainLayout.addWidget(self.label)
      if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          win = Window()
          win.show()
          sys.exit(app.exec_())
      

      Attachments

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              mhamid3d Mohammed Hamid
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes