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

Got wrong default-font after qApp->setFont () on macOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.12
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      Qt5.12.2
    • Platform/s:
      macOS

      Description

      Hi there,
      I have installed the font "JetBrains Mono" on windows10, centos8 and macOS 11.2.3. The application UI got correct font on both windows10 and centos8 after I change the default font of application. But the application UI got wrong font on macOS. the code as following

      QString cJetBrainsMono ("JetBrains Mono");
      QFont defaultFont (cJetBrainsMono, 8);
      qApp->setFont (defaultFont);
      if (qApp->font ().family ().compare (cJetBrainsMono) != 0)
      qApp->setFont (QFontDatabase::systemFont (QFontDatabase::FixedFont));

      PS: in debug mode, qApp->font ().family ().compare (cJetBrainsMono) is true on macOS, UI with wrong font

        Attachments

        1. macOS.jpg
          macOS.jpg
          96 kB
        2. win10.PNG
          win10.PNG
          76 kB
        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:
            james.lin James Lin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes