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

The quality of font rendering has dropped dramatically since version 6.8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0, 6.8.1
    • GUI: Font handling
    • None
    • Windows

    Description

      this is original issue https://bugreports.qt.io/browse/PYSIDE-2950

      Reposted here at the core dev's request

       

      After the update, I found that my interface fonts began to appear jagged and blurred. After careful comparison, I found that the font rendering quality has declined significantly since version 6.8.

       

      See the attached comparison pictures, with the corresponding Qt version in the title. You can quickly switch back and forth and see a very obvious decline.

       

      The font used is HarmonyOS Sans SC(https://fontmeme.com/fonts/harmonyos-sans-sc-font/), but you can replicate this with any font.

       

      Added YaHei font sample, you can see a more obvious drop in rendering quality, and this font is Microsoft's default East Asian font

       

      #include <QApplication>
      #include <QLabel>
      #include <QVBoxLayout>
      #include <QWidget>
      
      const QString CONTENT_EN = "Qt empowers productivity across the entire product development lifecycle";
      const QString CONTENT_CN = "Qt 赋能整个产品开发生命周期的生产力";
      const QString CONTENT_JP = "Qt は製品開発ライフサイクル全体にわたって生産性を高めます";
      
      class CaptionLabel : public QLabel {
      public:
          explicit CaptionLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 12px; font-weight: Regular");
          }
      };
      
      class BodyLabel : public QLabel {
      public:
          explicit BodyLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 12px; font-weight: Regular");
          }
      };
      
      class BodyStrongLabel : public QLabel {
      public:
          explicit BodyStrongLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 14px; font-weight: Bold");
          }
      };
      
      class SubTitleLabel : public QLabel {
      public:
          explicit SubTitleLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 20px; font-weight: Bold");
          }
      };
      
      class TitleLabel : public QLabel {
      public:
          explicit TitleLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 28px; font-weight: Bold");
          }
      };
      
      class TitleLargeLabel : public QLabel {
      public:
          explicit TitleLargeLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 40px; font-weight: Bold");
          }
      };
      
      class DisplayLabel : public QLabel {
      public:
          explicit DisplayLabel(const QString& text, QWidget* parent = nullptr) : QLabel(text, parent) {
              setStyleSheet("font-family: MicroSoft Yahei; font-size: 68px; font-weight: Bold");
          }
      };
      
      class Win : public QWidget {
      public:
          explicit Win(QWidget* parent = nullptr) : QWidget(parent) {
              setWindowTitle("Qt 6.8.1 Font Rendering with MicroSoft Yahei");
      
              // Create labels
              auto captionLabel = new CaptionLabel(CONTENT_EN, this);
              auto captionLabelCN = new CaptionLabel(CONTENT_CN, this);
              auto captionLabelJP = new CaptionLabel(CONTENT_JP, this);
      
              auto bodyLabel = new BodyLabel(CONTENT_EN, this);
              auto bodyLabelCN = new BodyLabel(CONTENT_CN, this);
              auto bodyLabelJP = new BodyLabel(CONTENT_JP, this);
      
              auto bodyStrongLabel = new BodyStrongLabel(CONTENT_EN, this);
              auto bodyStrongLabelCN = new BodyStrongLabel(CONTENT_CN, this);
              auto bodyStrongLabelJP = new BodyStrongLabel(CONTENT_JP, this);
      
              auto subTitleLabel = new SubTitleLabel(CONTENT_EN, this);
              auto subTitleLabelCN = new SubTitleLabel(CONTENT_CN, this);
              auto subTitleLabelJP = new SubTitleLabel(CONTENT_JP, this);
      
              auto titleLabel = new TitleLabel(CONTENT_EN, this);
              auto titleLabelCN = new TitleLabel(CONTENT_CN, this);
              auto titleLabelJP = new TitleLabel(CONTENT_JP, this);
      
              auto titleLargeLabel = new TitleLargeLabel(CONTENT_EN, this);
              auto titleLargeLabelCN = new TitleLargeLabel(CONTENT_CN, this);
              auto titleLargeLabelJP = new TitleLargeLabel(CONTENT_JP, this);
      
              auto displayLabel = new DisplayLabel(CONTENT_EN, this);
              auto displayLabelCN = new DisplayLabel(CONTENT_CN, this);
              auto displayLabelJP = new DisplayLabel(CONTENT_JP, this);
      
              // Create layout
              auto mainLayout = new QVBoxLayout(this);
              mainLayout->setAlignment(Qt::AlignTop);
      
              // Add widgets to layout
              mainLayout->addWidget(captionLabel);
              mainLayout->addWidget(captionLabelCN);
              mainLayout->addWidget(captionLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(bodyLabel);
              mainLayout->addWidget(bodyLabelCN);
              mainLayout->addWidget(bodyLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(bodyStrongLabel);
              mainLayout->addWidget(bodyStrongLabelCN);
              mainLayout->addWidget(bodyStrongLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(subTitleLabel);
              mainLayout->addWidget(subTitleLabelCN);
              mainLayout->addWidget(subTitleLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(titleLabel);
              mainLayout->addWidget(titleLabelCN);
              mainLayout->addWidget(titleLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(titleLargeLabel);
              mainLayout->addWidget(titleLargeLabelCN);
              mainLayout->addWidget(titleLargeLabelJP);
              mainLayout->addSpacing(20);
      
              mainLayout->addWidget(displayLabel);
              mainLayout->addWidget(displayLabelCN);
              mainLayout->addWidget(displayLabelJP);
          }
      };
      
      int main(int argc, char *argv[]) {
          QApplication app(argc, argv);
          Win win;
          win.show();
          return app.exec();
      }
      
      

      Attachments

        1. 6.7.3.png
          6.7.3.png
          196 kB
        2. 6.7.3-Yahei.png
          6.7.3-Yahei.png
          193 kB
        3. 6.8.1.png
          6.8.1.png
          170 kB
        4. 6.8.1-Yahei.png
          6.8.1-Yahei.png
          176 kB
        5. screenshot-1.png
          screenshot-1.png
          55 kB
        6. screenshot-2.png
          screenshot-2.png
          56 kB
        7. screenshot-3.png
          screenshot-3.png
          63 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-131946
          # Subject Branch Project Status CR V

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              rainzee rainzee wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change