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

Wrong family for QFont::Monospace on Ubuntu

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 4.8.4
    • Fix Version/s: 5.0.0
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      Ubuntu 13.04 (same happens on older versions, but QtWebKit works fine there)
      Fontconfig 2.10.2
      Qt 4.8.4 (does not happen with Qt 5)

      Description

      Originally I reported bug 114618 in QtWebKit stating that monospace fonts were rendered as non-monospace, but it seems that the issue is deeper, so I was redirected here.

      This code:

      QFont font;
      font.setStyleHint(QFont::Monospace);
      QDebug() << font.defaultFamily();
      

      prints “Courier New” on my Ubuntu system, but I don’t have this font installed.

      When I replace QFont::Monospace with QFont::TypeWriter, it prints just “Courier”, which also doesn’t exist.

      The default fontconfig monospace font on my system is “DejaVu Sans Mono”:

      $ fc-match monospace
      DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
      

      Because of this bug QtWebKit renders all font-family: monospace blocks using non-monospace font, so it is quite a critical issue.

        Attachments

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

          Activity

            People

            • Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              mandriver Dmitry Shachnev
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes