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

Impossible to use different flavours of a font in the same project without changing the font's "Font Family"

    XMLWordPrintable

Details

    • Android

    Description

      We use the default Android font in our embedded application:
      http://developer.android.com/design/style/typography.html

      We want to use different flavours of this font (Regular, Light, Bold, Medium) in our app.

      However, from QML, the font can only be specified by "font.family". All of these .ttf files contain the same font family name (which makes sense).

      Setting font.bold to true on the Roboto Regular font produces a different end result than using the Roboto-bold.ttf file.
      Likewise, playing around with font.weight does not yield any decent result. Both of these seem to process the existing font instead of looking for the different flavors of the font (like native applications do).

      We need a way of accessing the different flavours of a font from QML.

      For now, we have worked around this issue by editing the Roboto font and changing the "Family name" field and saving them as totally different fonts.

      Attachments

        1. comparison-reporter.png
          comparison-reporter.png
          77 kB
        2. fontcomparisons.png
          fontcomparisons.png
          10 kB
        3. linux-distancefield.png
          linux-distancefield.png
          30 kB
        4. linux-native.png
          linux-native.png
          17 kB
        5. OSX-distancefield.png
          OSX-distancefield.png
          47 kB
        6. OSX-native.png
          OSX-native.png
          40 kB
        7. Roboto.zip
          551 kB
        8. RobotoCondensedProblemOnMac.png
          RobotoCondensedProblemOnMac.png
          122 kB

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              yvedebuysscher Yve De Buysscher
              Votes:
              11 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes