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

Qml font weight and styleName not working (not rendered correctly)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      macOS / Windows 10
    • Platform/s:
      macOS, Windows

      Description

      I import different types of the font "Helvetica Neue":

      // load fonts from resources
      int fontId0 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Regular.ttf");	
      int fontId1 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-CondensedBlack.ttf");	
      int fontId2 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Light.ttf");	
      int fontId3 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-Thin.ttf");	
      int fontId4 = QFontDatabase::addApplicationFont(":/font/HelveticaNeue-UltraLight.ttf");
      

      In order to use e.g. "Helvetica Neue UltraLight" under macOS I have to set the font.styleName property to "UltraLight":

      font.styleName: "UltraLight"
      

      The same code doesn't work on Windows 10. 

      To use the same font on Windows 10 the font.weight property must be set to "Font.ExtraLight" (this in return is not working on macOS):

      font.weight: Font.ExtraLight
      

       

       

        Attachments

          Issue Links

          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:
              michelmuerner Michel Mürner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes