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

Expose QFont::styleName() to Qt Quick

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.0 RC
    • 5.2.1, 5.3.0 Alpha
    • None
    • Qt 5.3.0 stable branch as of today on iOs 7.1, Mac 10.9.1

    • e01bea8999d2f58add58874bd3e6792f509b131b

    Description

      Many fonts in iOs (and many other platforms) are shipped with one common family name but having different styles that look totally different.
      For example Helvetica Neue on iOs has these styles:

      "Helvetica Neue" => 
      ("Regular", "Bold", "Bold Italic", "Italic", "Medium", "Medium Italic",
       "Condensed Black", "Condensed Bold", "Light", "Light Italic",
       "Thin", "Thin Italic", "UltraLight", "UltraLight Italic")
      

      But Qt Quick doesn't have a way to chose these styles (rather sub-families?)

      I have tried ',' separating both but no luck

      Text{
         font{
            family: "Helvetica Neue, Condensed Black"
            pixelSize: 18
         }
         text: "Not rendered as expected"
      }
      

      Update/Analysis:

      On Further debugging through font matching in latest Qt code (stable branch), the issue is actually 2-fold:

      • No way to specify styleName
      • Bug in bestFoundry() in qfontdatabase.cpp which doesn't take care of styleName. Basically bestStyle() is being called with empty styleName which makes it to choose the first style always

      Attachments

        Issue Links

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

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              sunilpro Sunil Reddy
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes