Forums

OverviewV-Play 1 SupportCustom fonts on Android › Re: Custom fonts on Android

OverviewV-Play 1 SupportCustom fonts on Android › Re: Custom fonts on Android
#4117

Alex
V-Play Team

Hi,

thanks to you this is now a known issue, yes. 😉

As it turns out, the font loader item loads the font as “Spatha”, Android however registers the font as “Spatha Sans” and therefore can’t load the font correctly. We will add a fix for this in the next update, in the meanwhile you can manually override the font name on Android only.

I guess you have a FontLoader item like


  FontLoader {
    id: spatha
    source: "Spatha.ttf"
  }

in your code. Please try to extend the loader according to following snippet:


  FontLoader {
    id: spatha
    source: "Spatha.ttf"

    Component.onCompleted: {
      // Explicitly set the font name on Android to Spatha Sans
      if (system.platform === System.Android)
        name = "Spatha Sans"
    }
  }

Cheers,
Alex

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support