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

Inconsistent rendering for bold variable fonts set via setWeight/setVariableAxis

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0
    • GUI: Text handling
    • None
    • Linux/Wayland, Linux/X11

    Description

      Test program:

      from PySide6.QtWidgets import QApplication, QVBoxLayout, QWidget, QLabel
      from PySide6.QtGui import QFont
      import sys
      
      def main():
          app = QApplication(sys.argv)
          window = QWidget()
          box = QVBoxLayout()
          
          label1= QLabel("setWeight: The quick brown fox jumps over the lazy dog")
          font1 = QFont("Cantarell", 12)
          font1.setWeight(QFont.Bold)
          label1.setFont(font1)
          
          label2 = QLabel("setVariableAxis: The quick brown fox jumps over the lazy dog")
          font2 = QFont("Cantarell", 12)
          font2.setVariableAxis(QFont.Tag("wght"), float(QFont.Bold))
          label2.setFont(font2)
      
          box.addWidget(label1)
          box.addWidget(label2)
      
          window.setLayout(box)
          window.show()
      
          sys.exit(app.exec())
      
      if __name__ == "__main__":
          main()

       

      Screenshot: 

       

      I would expect similar rendering for both case, but the setWeight case looks like synthesized bold on top of wght=700 variant.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            dantmnf dantmnf
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes