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

Android: Demibold font can take presedence over regular

    XMLWordPrintable

Details

    • Android

    Description

      Get the Open Sans fonts from Google: http://www.fontsquirrel.com/fonts/open-sans

      Then run the following example:

      import QtQuick 2.4
      import QtQuick.Controls 1.2
      
      ApplicationWindow {
          id: window
          width: 400
          height: 400
          visible: true
      
          property FontLoader __openSansRegularLoader: FontLoader {
              source: "OpenSans-Regular.ttf"
          }
      
          property FontLoader __openSansLightLoader: FontLoader {
              source: "OpenSans-Light.ttf"
          }
      
          property FontLoader __openSansDemiBoldLoader: FontLoader {
              source: "OpenSans-Semibold.ttf"
          }
      
          
          property int renderType: Text.NativeRendering
      
          Row {
              Text {
                  text: "Blah"
                  font.family: "Open Sans"
                  font.pixelSize: 48
                  renderType: window.renderType
              }
              Text {
                  text: "Blah"
                  font.family: "Open Sans"
                  font.pixelSize: 48
                  font.weight: Font.Light
                  renderType: window.renderType
      
              }
              Text {
                  text: "Blah"
                  font.family: "Open Sans"
                  font.pixelSize: 48
                  font.weight: Font.DemiBold
                  renderType: window.renderType
      
              }
          }
      }
      

      The Light font works fine, but the Regular font is replaced by the DemiBold version instead. If you change the order of the FontLoader objects so that the Regular font is loaded last, it works fine.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes