Hello Guest

Author Topic: Problems with font/tk2dTextMesh  (Read 11520 times)

tayasui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problems with font/tk2dTextMesh
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #1 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...

tayasui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #2 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #3 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.

tayasui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #4 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.

tayasui

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #5 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with font/tk2dTextMesh
« Reply #6 on: February 10, 2012, 09:12:25 pm »
Thanks for sharing - I will look into this before the next release.