2D Toolkit Forum

2D Toolkit => Support => Topic started by: kliqingk on June 07, 2013, 09:32:17 am

Title: Custom font doesn't work.
Post by: kliqingk 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.
Title: Re: Custom font doesn't work.
Post by: unikronsoftware 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
Title: Re: Custom font doesn't work.
Post by: kliqingk 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.
Title: Re: Custom font doesn't work.
Post by: unikronsoftware 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.
Title: Re: Custom font doesn't work.
Post by: kliqingk on June 07, 2013, 02:47:35 pm
The .tga file is too large to upload it. So I compressed them.
Title: Re: Custom font doesn't work.
Post by: unikronsoftware 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.
Title: Re: Custom font doesn't work.
Post by: kliqingk on June 08, 2013, 03:23:20 am
Thank you for your helping. It works.