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

FontLoader: Loading font from resources not supported on iOS

XMLWordPrintable

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

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes