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

QFontDialog.MonospacedFonts misses valid monospace fonts on linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.0
    • GUI: Font handling
    • None
    • Tested on Ubuntu 19.10, but also received reports of this issue from a user of ours on Debian/Sid
    • Linux/X11

    Description

      The following pyside snippet will NOT show the Fira Code OTF font when run on linux, but /will/ show it on MacOS (I haven't checked Windows yet).

      from PySide2.QtWidgets import QApplication
      from PySide2.QtWidgets import QFontDialog
      app = QApplication()
      QFontDialog.getFont(None, None, options=QFontDialog.DontUseNativeDialog | QFontDialog.MonospacedFonts)
      sys.exit(app.exec_())

      I have confirmed that Fira Code is a monospace font and is installed on linux via the following (also, it's usable in other apps that filter for monospace like the terminal):

      $ fc-match -a monospace|grep -i fira
      FiraCode-Regular.otf: "Fira Code" "Regular"
      FiraCode-Retina.otf: "Fira Code" "Retina"
      FiraCode-Medium.otf: "Fira Code" "Medium"
      FiraCode-Light.otf: "Fira Code" "Light"
      FiraCode-SemiBold.otf: "Fira Code" "SemiBold"
      FiraCode-Bold.otf: "Fira Code" "Bold"

      I've included the PySide2 for reproducibility but the same bug exists in the native APIs as well.  The bug is also there whether or not the QFontDialog.DontUseNativeDialog option is used. 

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            psifertex Jordan Wiens
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes