Author Topic: Dynamic Font Size Considerations  (Read 1801 times)

kromenak

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Dynamic Font Size Considerations
« on: January 08, 2014, 01:44:44 PM »
I'm finding that the font size changes in the latest NGUI have a lot of potential for flexibility - it's pretty cool to have a dynamic font and be able to size it to fit each specific circumstance. 

However, I had a concern about the font atlas generated by NGUI/Unity.  Let's say I have five labels that are all using a font size of 24.  I'm guessing this will cause the font atlas to have all the required letters in size 24.  But what if each of the five labels has a different font size?  Will this mean that many letters will get duplicated on the font atlas because of the size differences?  Would this cause memory issues in some circumstances?

I'm developing mainly for iOS and Android, so I'm worried there may be performance or memory concerns with this.  Previously, we had defined two font sizes, 40 and 80, and we only used these with scale adjustments.  Is that a better approach, or is it OK to have many different font sizes throughout the game - 16, 22, 24, 30, 31, 40, etc?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic Font Size Considerations
« Reply #1 on: January 08, 2014, 01:47:13 PM »
Labels have a "keep crisp" option when using dynamic fonts. If true, then yes, you will end up with various sizes when text is shrunk. If false, then the label will simply shrink, reusing the same size font.