Author Topic: Font character placement is off  (Read 3482 times)

roady

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 30
    • View Profile
Font character placement is off
« on: October 07, 2014, 12:09:46 PM »
I've encountered a strange issue in my project. The characters in some UILabel is a bit off.
Tried for a couple of hours and decided to create a new scene and rebuild the GUI. Same issue appear.
I've also tried to run .MakePixelPerfect() on some of them to see if it helps with no success.

Created fonts with GlyphDesigner and using an reference font to get pixel perfect for different resolutions.

Here is a text perfect


But compare to this area where all texts have each character in a offset x,y 1-2 pixels

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Font character placement is off
« Reply #1 on: October 08, 2014, 01:07:33 PM »
I'm not sure what I'm looking at with the screenshots. What's offset? Where?

roady

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: Font character placement is off
« Reply #2 on: October 09, 2014, 01:09:38 PM »
If you are looking at the large screenshot. Look at every word, every character. You will see that they are slightly off in their positions. They are not following a straight line or has the proper width. So both x and y position is weird.

Tried to remove all atlases, re-create them. Even started with a new scene but after a while some of them got strange again.

Started to try out using NGUI Unity Font instead. Works a lot better =)

Don't know if there's some Unity cacheing maybe for positions or something else that destroys the positions. It works in some cases.  ???

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Font character placement is off
« Reply #3 on: October 10, 2014, 02:34:15 AM »
Use the NGUI font maker to create the font. Adding a 1 pixel border around your font by selecting the font prefab and clicking the +1 button might also help.