[SOLVED] SpriteFontPlus on Android/iOS?

I working on a project where the user can enter text, such as email address to login, or choose a display name. Running into a problem the MonoGame SpriteFont where it shits the bed if any glyphs are not included. I’m trying to use SpriteFontPlus but having a hard time getting it working on Android & iOS, since it needs to read in a raw .ttf file.

Has anyone gotten this working on mobile, or have another recommendation for SpriteFont alternatives?
Cheers!

I’ve used SpriteFontPlus on Android. Worked fine for me. Got help from the creator on discord

I wrote a Content Pipeline extension and got it working slick as hell:

example app:

Feeling extremely smug right now :grinning:

Hi,
You can copy ttf file to Assets folder of the Android project, it’ll be then automatically get deployed.
Then you could load it into byte array(that could be passed to SpriteFontPlus) like this:

  byte[] data;
  using(var stream = TitleContainer.Open(fileName))
  {
    using(var ms = new MemoryStream())
    {
      stream.CopyTo(ms);
      data = ms.ToArray();
    }
  }
1 Like

Thank you! I got it working so that .ttf files can be added to the content project and loaded from a ContentManager object. I like it this way because now all my .ttf and .spritefont files are in one place :slight_smile:

Also thanks for your work on this library :slight_smile:

Cheers!