Author Topic: 3.0 -- Possible to do fixed-size multiline text with UILabel?  (Read 2189 times)

MrTact

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
3.0 -- Possible to do fixed-size multiline text with UILabel?
« on: October 06, 2013, 02:54:07 PM »
We are in the process of upgrading to 3.0 and I have a use case that I'm not quite sure how to address with the new UILabel. We have blocks of text of varying sizes that need to fit into a particular space (think description text on inventory items). For most of our uses of UILabel, we are setting max lines = 0 and shrink to fit, which works fine. For these multiline descriptions, however, doing this can cause short lines of text to expand to fill the available space, which is not the preferred effect.

Until now we have been able to get by using one size font and letting UILabel scale it, but the only way I can see to create the desired effect here is to bake a new font at the appropriate size and use a non-scaling option (like clamp content) on the label. Is that right or am I missing something?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0 -- Possible to do fixed-size multiline text with UILabel?
« Reply #1 on: October 06, 2013, 09:57:13 PM »
If you're using dynamic fonts, you can have any number of them of different base size coming from the same TTF file, and they will all get batched together by the system.

MrTact

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
Re: 3.0 -- Possible to do fixed-size multiline text with UILabel?
« Reply #2 on: October 07, 2013, 09:53:38 AM »
Yes, creating new fonts was less about performance concerns and more about convincing the artists to pick a handful of type sizes and stick with them :-)