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

FontLoader: Loading font from resources not supported on iOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0
    • 5.2.0
    • QPA
    • None
    • iOS/tvOS/watchOS

    Description

      FontLoader does not support loading font from resource file in iOS:
      "This plugin does not support application fonts
      qrc:/qml/gallery.qml:184:5: QML FontLoader: Cannot load font: "qrc:/fonts/OpenSans-Regular.ttf""

      As a workaround you can use:

          FontLoader {
              id: myFont
              Component.onCompleted: {
                  if (Qt.platform.os === "ios")
                      name = "My Font"
                  else
                      source = "qrc:/fonts/MyFont-Regular.ttf"
              }
           }
          }
      

      And load "My Font" using the workaround described in QTBUG-34490

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              carochao Caroline Chao (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes