Author Topic: Dynamic font pixel perfect?  (Read 5695 times)

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Dynamic font pixel perfect?
« on: December 11, 2014, 02:21:29 PM »
Hi there !
We are still using an old version of NGUI, I'm wondering if you still support older version, but yeah, anyway...
I'm using a dynamic font for my UILabel, everything works fine, but on all my fonts the lowest and the highest line of pixel of the font is cut (and I think the left and right colon for each character too), which is not that elegant right now. It does not depend on font size, which means that on a very huge font size the problem is almost invisible, but on smaller ones, it's really annoying.

I've attached with this thread an example showing the problem.

I'm currently using version 3.5.3

Thanks !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font pixel perfect?
« Reply #1 on: December 12, 2014, 11:28:01 PM »
That's just how the font is the way it comes from Unity.

Using a bitmap font it's possible to add 1 pixel border around your characters, but dynamic font = all Unity, and I have no control over it.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: Dynamic font pixel perfect?
« Reply #2 on: January 19, 2015, 05:08:28 PM »
Well, let's hope UT will improve this soon or later...

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: Dynamic font pixel perfect?
« Reply #3 on: February 03, 2015, 05:33:52 PM »
That's just how the font is the way it comes from Unity.

Using a bitmap font it's possible to add 1 pixel border around your characters, but dynamic font = all Unity, and I have no control over it.
You told me that with dynamic font it's all UT fault, but it seems to be the same issue with bitmap fonts. When I check the bitmap file, it's all correct, but once on UILabel I still have the weird issue. Do I need to add something special to my bitmap file? (I used both BMFont and your Font Maker with FreeType).

Edit: Ok if I add a padding with BMFont it will fix it.
« Last Edit: February 03, 2015, 05:39:55 PM by cayou »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic font pixel perfect?
« Reply #4 on: February 05, 2015, 08:57:35 AM »
You can add +1 padding just by selecting the font prefab.