Author Topic: Vertical spacing on dynamic fonts  (Read 2214 times)

Nacho

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
Vertical spacing on dynamic fonts
« on: May 21, 2014, 02:59:06 AM »
Hello. I'm migrating my current project from NGUI 2 to 3. I've used the migration tools and so far everything's going smoothly. However, I still need to fix the labels and I have ran into a problem I'm not sure how to fix.

This is an image of my old version of the project, which uses bitmap fonts. And this is an image of the latest version, which uses a dynamic font instead. Notice that the vertical spacing is different for each version. While on the old version the label is properly centered in the vertical axis, in the newest version it's not. I tried looking up in the documentation for dynamic fonts, but I couldn't find a way to configure that vertical spacing (if that's the solution to the problem).

Any ideas? Thanks in advance!

Cheers,

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Vertical spacing on dynamic fonts
« Reply #1 on: May 21, 2014, 05:21:02 AM »
I think you forgot to post the pictures.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Vertical spacing on dynamic fonts
« Reply #2 on: May 21, 2014, 11:54:01 AM »
Well, why did you switch to dynamic fonts? If you want the behaviour to match, wouldn't it make sense to stick to the same type of fonts?

Nacho

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Vertical spacing on dynamic fonts
« Reply #3 on: May 22, 2014, 12:03:31 AM »
Thank you both for your replies.

@Nicki: Notice that I've embedded two links to the images in my post.

@Aren: From what I read in the forums, dynamic fonts have lots of advantages, so I thought it would be a good idea to make the switch now that I'm in the middle of the migration process. What I did is use the same TTF file used ages ago in order to create the bitmap font as the starting point for the dynamic font. I would expect the vertical spacing to be the same for both, but that doesn't seem to be the case, what am I missing?

Cheers,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Vertical spacing on dynamic fonts
« Reply #4 on: May 22, 2014, 03:38:46 PM »
Dynamic fonts have quite a few disadvantages too, like no kerning information, slower performance, and certain other issues that can cause letters to flat out disappear due to the way Unity works. Your dynamic font is also quite a bit lower res than your bitmap font. You can make dynamic and bitmap fonts look close, but you won't make them match.