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

QFont(family string) returns unexpected font

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.2.0
    • PySide
    • None
    • Python 3.8
      Qt 6.2.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.2.1 20201112 (Red Hat 10.2.1-8)) [limited API]
    • 0c4b73611801c788849f0bcf93737c670b61ee03 (pyside/pyside-setup/dev) 706fc86ac231208894ff7e2e8b26bfe596f55a45 (pyside/pyside-setup/6.2)

    Description

      Hi,

      QFont(family string) returns unexpected font.

      In PySide6, QFont() handles string argument as character list unexpectedly.

      By this problem, Iconic font cannot show expected icon.

       

      # wget https://raw.githubusercontent.com/dovy/elusive-icons/master/fonts/elusiveicons-webfont.ttf
      
      family = "elusiveicons"
      font = QFont(family)
      print(f"input: {family}, font: family: {font.family()}, families: {font.families()}")
      
      # PySide2
      input: elusiveicons, font: family: elusiveicons, families: []
      
      # PySide6
      input: elusiveicons, font: family: e, families: ['e', 'l', 'u', 's', 'i', 'v', 'e', 'i', 'c', 'o', 'n', 's']
       
      

      I attached reproducible script, which shows address book symbol.
      Please note https://raw.githubusercontent.com/dovy/elusive-icons/master/fonts/elusiveicons-webfont.ttf needs to be downloaded for executing the script.

       

      "python3.8 pyside-qfont.py --pyside2" shows address book symbol as expected, but "python3.8 pyside-qfont.py --pyside6" shows alternative symbol unexpectedly.

       

      Attachments

        1. pyside1685.zip
          49 kB
        2. pyside-qfont.py
          2 kB
        3. pyside-qfont-pyside2.png
          pyside-qfont-pyside2.png
          5 kB
        4. pyside-qfont-pyside6.png
          pyside-qfont-pyside6.png
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            kumattau kuma ttau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes