Hello Guest

Author Topic: Importing BMFonts doesn't work  (Read 4312 times)

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Importing BMFonts doesn't work
« on: March 12, 2014, 12:00:14 am »
There's no two ways about it, importing a BM Font and then attempting to use it in a text mesh is broken and doesn't work.

I've tried several times, following these instructions:

http://www.unikronsoftware.com/2dtoolkit/doc/2.00/tutorial/preparing_a_font.html

..to the letter, to do this, but each time I create a new text mesh and change to my new font, it 'bugs out'.  The font in the scene remains what was last selected, until I try typing something new, then the textmesh disappears altogether.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Importing BMFonts doesn't work
« Reply #1 on: March 12, 2014, 11:43:46 am »
What version of 2D Toolkit are you using?
What version of Unity?
What font have you exported? Can you post the .fnt and png here? What was it created in?

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Importing BMFonts doesn't work
« Reply #2 on: March 12, 2014, 09:02:41 pm »
I just made a fresh install of Unity and 2DToolkit a couple weeks ago, so the latest version of both.  I confirmed that today.

I included the .fnt file and the .png.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Importing BMFonts doesn't work
« Reply #3 on: March 12, 2014, 09:31:50 pm »
Whatever you're using to generate the font is spitting out incorrect xml. Specifically the encoding of the file is wrong, for example dragging the file into Google Chrome window will trigger an error too. (it should just load in and display as a tree)

The error is specifically the name of the font face, it contains a non-ascii character, but the file itself doesn't have any encoding set on it. Edit the file and remove the Æ character to fix it.

It would have probably worked if you picked text output instead of xml.

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Importing BMFonts doesn't work
« Reply #4 on: March 13, 2014, 03:15:33 am »
I was using BMFonts.  I fixed the XML, but got the same result.  I recreated the in BM Fonts several times, and finally got one that worked, by some fluke, so I'm using that.  Thanks.