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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.1
    • None
    • macOS / Windows 10
    • 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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              michelmuerner Michel Mürner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: