Hello Guest

Author Topic: Custom font doesn't work.  (Read 6360 times)

kliqingk

  • Newbie
  • *
  • Posts: 14
    • View Profile
Custom font doesn't work.
« on: June 07, 2013, 09:32:17 am »
1. I made a  text font and texture from BMFont program. There are 1521 characters including '0'-'9'.
2. I created a Font object. Assign the text font and texture to the Font object.
3. Clicked "Commit" button.
4. I created a TextMesh using the Font object.
5. Set the text to "100".

Just three rectangles(six triangles) were shown.

Then I changed Bm Font and Texture with demo font and texture in tk2d_demo. "100" was shown.
But I used my custom font and texture in NGUI. It worked.
« Last Edit: June 08, 2013, 03:23:32 am by kliqingk »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Custom font doesn't work.
« Reply #1 on: June 07, 2013, 09:33:57 am »
What format did you save out the font as?
Did you follow the settings here?
http://unikronsoftware.com/2dtoolkit/doc/2.00/tutorial/preparing_a_font.html

kliqingk

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Custom font doesn't work.
« Reply #2 on: June 07, 2013, 11:08:00 am »
Yes, I followed the settings.

I saved out the font as .tga and font data as  txt.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Custom font doesn't work.
« Reply #3 on: June 07, 2013, 12:14:01 pm »
Send the font to support at unikronsoftware dot com. I'll take a look to see why it isn't working.

kliqingk

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Custom font doesn't work.
« Reply #4 on: June 07, 2013, 02:47:35 pm »
The .tga file is too large to upload it. So I compressed them.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Custom font doesn't work.
« Reply #5 on: June 07, 2013, 03:43:19 pm »
That font isn't set up following those instructions I linked earlier.
http://unikronsoftware.com/2dtoolkit/doc/2.00/tutorial/preparing_a_font.html
You have "Pack chars in multiple channels ticked". If you untick it and follow the instructions above, this font will work fine.

The good news is you helped uncover a bug in the experimental packed font system.
http://unikronsoftware.com/2dtoolkit/doc/2.00/advanced/packed_fonts.html
If you want for 2.0 hotfix it will be fixed in that version, or else post in the private support forum and I'll post the file in there.

kliqingk

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Custom font doesn't work.
« Reply #6 on: June 08, 2013, 03:23:20 am »
Thank you for your helping. It works.