2D Toolkit Forum

2D Toolkit => Support => Topic started by: tayasui on February 02, 2012, 03:03:19 pm

Title: Problems with font/tk2dTextMesh
Post by: tayasui on February 02, 2012, 03:03:19 pm
Hello,

I'm currently using tk2dTextMesh to display texts in my Unity Apps.
I'm experiencing some trouble with a specific font: some pixels which don't belong to some characters are displayed. You can see it on the attached screenshot.

I've used Hiero to generate the texture and the .bmfont file for "VAG-Bold 16px".
On Unity side, I've checked the option "Flip Texture Y", and selected 480 as "Target Height", 240 as "Target Ortho size" (considering the camera attributes).

Do you have any idea why this glitch happens?
Do you need more information?

Thanks,
Cl?ment.
Title: Re: Problems with font/tk2dTextMesh
Post by: unikronsoftware on February 03, 2012, 01:04:43 am
Two things to check first

- How many pixels of padding did you add to the font in bmfont / hiero? Try increasing this to see if it goes away.
- If you aren't scaling the texture, set it to point filtered, less chance of bleeding that way.

Let me know how it goes...
Title: Re: Problems with font/tk2dTextMesh
Post by: tayasui on February 03, 2012, 09:09:06 am
Thank you unikron,

Actually, I've already tried these solutions, but the results aren't what I expected: check the two screenshots to see that.
I think the best solution would be to use padding, but only if the tk2dTextMesh let me set the spacing between characters.

Cl?ment.
Title: Re: Problems with font/tk2dTextMesh
Post by: unikronsoftware on February 03, 2012, 11:25:30 pm
2D Toolkit isn't able to add padding to your font textures currently - the reasoning to leave this out is that it was easy enough to re-export from BMFont / Hiero with different padding settings. We can implement this feature if more people would find it useful - any feedback here would be greatly appreciated.
Title: Re: Problems with font/tk2dTextMesh
Post by: tayasui on February 03, 2012, 11:51:56 pm
Ok, thanks for your quick replies.
Congratulations on the great work you do on the 2D Toolkit.
Title: Re: Problems with font/tk2dTextMesh
Post by: tayasui on February 09, 2012, 06:19:22 pm
Hello,

If you are interested, I've made the modifications that I needed on the scripts.
Feel free to use it for the next release.

Cl?ment.
Title: Re: Problems with font/tk2dTextMesh
Post by: unikronsoftware on February 10, 2012, 09:12:25 pm
Thanks for sharing - I will look into this before the next release.