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

gtk3 platformtheme returns the font of GtkFixed widget instead of monospace font

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 6.5.0
    • GUI: Font handling
    • None
    • Linux/Wayland, Linux/X11
    • 034a071bd (dev), a95b43b97 (6.5), 8d1304f4f (dev), 0fa6b3dcf (6.6), e7797ebca (6.5)

      Here's FixedFont is being mapped to GtkFixed: https://github.com/qt/qtbase/blob/c1e1d133c47f6cbeee045dcec0dfe7c68d5bef34/src/plugins/platformthemes/gtk3/qgtk3interface.cpp#L546
      Looking at the description of GtkFixed widget, it's a completely wrong widget: https://docs.gtk.org/gtk3/class.Fixed.html
      See how libvte does that, it creates a custom widget with GTK_STYLE_CLASS_MONOSPACE CSS class (I guess creating a GtkWidget instance and adding the class to it will be enough for Qt use-case): https://gitlab.gnome.org/GNOME/vte/-/blob/master/src/widget.cc#L651-652

      I've got a report that an application uses a sans-serif font instead of the monospace font, so the QFontInfo::fixedPitch check seem to not really work, not in all cases at least.

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

            axelspoerl Axel Spoerl
            ilya-fedin Ilya Fedin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes