Author Topic: The 'right' NGUI 3.x.x way to manage dynamic font sizes  (Read 11732 times)

dkozlovtsev

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
The 'right' NGUI 3.x.x way to manage dynamic font sizes
« on: October 15, 2013, 05:54:18 AM »
What is the recommended way to resolve the following cituation:
two UILabels with dynamic font on it
one should be small, the other one is big

my options:
1. Create two fonts with different size - which is awful
2. Change Label scale to big and small respectevly - which is not too great either as it as i'd  like to avoid using scale for GUI

So what is considered to be the best way to do it?
« Last Edit: October 15, 2013, 06:09:11 AM by dkozlovtsev »

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #1 on: October 15, 2013, 08:43:19 AM »
At first I was making a ton of different fonts, using the NGUI Font deal, different sizes, padding, etc. etc.  It worked nicely but when I was around 12 different fonts I realized... what am I doing.

I just went with changing the scale.  The only annoyance is that a normal scale font with a clamp width of 100 px, when changed to .8 XY scale font, that same 100 px clamp width is actually more like 80 px.  You just adjust the width, thank goodness for the visual editor.

Not sure what's the 'best' way, maybe someone else can say.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #2 on: October 16, 2013, 02:08:56 AM »
Current Pro version of NGUI lets you specify font size on labels for dynamic fonts. You also no longer need to create UIFonts if you're using dynamic fonts. Just choose the UnityEngine.Font to use, and you're good to go.

dkozlovtsev

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #3 on: October 16, 2013, 02:12:03 AM »
@ArenMook
Thank you for your answer. It is good to know that this is issue is being adressed.
Looking forward for the release containing this feature !

Nubeh

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #4 on: October 25, 2013, 06:16:43 AM »
I'm new to NGUI and I'm trying to figure out the same...if I use dynamic fonts I can select to shrink the content in a label, clamp it and so on. By resizing the label object then I resize the font as well. The problem is that, even though I'm using a 'dynamic font' it still looks blurry on an iPad for example.

The native dynamic fonts of Unity look crisp when you dynamically set the font size in the OnGUI call so I was wondering how to get the same result using NGUI.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #5 on: October 26, 2013, 10:11:36 PM »
In 3.0.3 you can choose "keep crisp" on the labels using dynamic fonts, so even when they shrink they will still be crisp.

Nubeh

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #6 on: October 29, 2013, 04:27:58 AM »
I have the Keep Crisp option set to Always but my text is not crisp at all. I tested on both iPad2 and Galaxy S4 an in both case the font is not as crisp as if I use the Unity native Dynamic font with the GUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The 'right' NGUI 3.x.x way to manage dynamic font sizes
« Reply #7 on: October 29, 2013, 04:56:43 PM »
Didn't I already answer this question a few hours ago? There are many reasons why font may not be crisp: Unity 3.5.7, Fixed Size setting on UIRoot, not pixel perfect objects leading up to your labels, non-1 scale... the list goes on. Check all the usual suspects.