Author Topic: Font sizes  (Read 6191 times)

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Font sizes
« on: May 26, 2012, 03:33:18 AM »
Hi,

I'm just wondering what the best practice for different sized fonts would be? At the moment i'm thinking of adding a font in the maximum size i'll need and then reducing the size in Unity Scene view.

Is that the right way to go or should I create a few font sizes out of BMFont and add them to the atlas?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Font sizes
« Reply #1 on: May 26, 2012, 10:50:37 AM »
Resizing more than roughly 50 % will cause ugly ugly artifacting because of filtering.  It's particularly evident in fonts because of the sharp edges and the way we read them, as opposed to regular old textures which can blur much more forgivingly.

In smaller fonts, you don't want to be resizing it at all, since it corrupts so easily.

Figure out how many sizes you need, and make as many as you must - resizing from 60 to 40 is doable, but from 10 to 20 or the other way is bad.

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Font sizes
« Reply #2 on: May 26, 2012, 10:52:40 AM »
Thanks for the reply. I've gone with a font of 50 and another of 24. Good to know i'm on the right track.  ;D

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: Font sizes
« Reply #3 on: March 04, 2013, 12:45:59 AM »
Resizing more than roughly 50 % will cause ugly ugly artifacting because of filtering.  It's particularly evident in fonts because of the sharp edges and the way we read them, as opposed to regular old textures which can blur much more forgivingly.

In smaller fonts, you don't want to be resizing it at all, since it corrupts so easily.

Figure out how many sizes you need, and make as many as you must - resizing from 60 to 40 is doable, but from 10 to 20 or the other way is bad.

I'm currently trying to get fonts sorted out in my project using the method detailed here, but I'm having some issues.

Originally, I had a single font in my atlas at size 64 (the largest I ever wanted) and then I would set the scale on labels to the desired sizes (e.g. (40,40,1).

I was finding that this was not very crisp on screen when running on anything below my game's native resolution (2048x1536). It wasn't TERRIBLE, but just not as nice as I would like.

I then stumbled on this thread and figured this would be the answer. I created multiple fonts in my atlas - e.g. font35, font45, font55, etc. When I then use a font (e.g. font45) I set it's scale to match (e.g. (45,45,1)).

What I'm finding though is that it's a lot worse than before - much blurrier, less-crisp, etc.

So, I wanted to clarify that there aren't any other "steps" that I'm missing? Something that I could be doing wrong?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Font sizes
« Reply #4 on: March 04, 2013, 10:42:40 AM »
Instead of setting the scale, try using MakePixelPerfect() on it.
The fonts made in BMFont or similar, don't match entirely to the same scale you set in Unity. So a fontsize of 30, might give you 34 on localscale in unity.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: Font sizes
« Reply #5 on: March 04, 2013, 03:53:53 PM »
Instead of setting the scale, try using MakePixelPerfect() on it.
The fonts made in BMFont or similar, don't match entirely to the same scale you set in Unity. So a fontsize of 30, might give you 34 on localscale in unity.

Interesting! Thanks for the info... I'll experiment with it.