Author Topic: UILabel font size and ClampContent  (Read 13360 times)

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
UILabel font size and ClampContent
« on: November 01, 2013, 04:31:30 AM »
Hi!

I use UIInput (with BitmapFonts) for my chat input. In design (photoshop) font size = 12. If i do export font (BMFont) with a similar size, it looks very bad inside Unity.
So I make export a big font size (eg 36).
For chat input i set UILabel to ClampContent (for long strings). But after I reduce the size (height dimension) of the label from 36 to eg 16, label disappears.
What should I do? How to make a small font with good quality? Is very different from the font design in Photoshop.
I have a tool ShoeBox, but it has no kerning pairs for cyrillic  :(

Thanks!
« Last Edit: November 01, 2013, 04:52:33 AM by broken »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel font size and ClampContent
« Reply #1 on: November 01, 2013, 06:02:56 AM »
Clamp means just that -- clamp it. If it doesn't fit, remove it.

Shrink is what you want.

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #2 on: November 02, 2013, 07:01:00 AM »
Clamp means just that -- clamp it. If it doesn't fit, remove it.

Shrink is what you want.

But I need to carriage was always visible, even if the input string does not fit in the control (like in your Chat example, there is Clamp Content).
And when I present the Shrink (or Clamp), when UIInput is selected the option Encoding (use emoticons ...) for UILabel automatically removed from the label (I need to use emoticons), what is that?.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel font size and ClampContent
« Reply #3 on: November 02, 2013, 08:06:50 AM »
Input field text can't support symbols and color encoding. It has always been like that.

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #4 on: November 03, 2013, 07:05:33 AM »
Input field text can't support symbols and color encoding. It has always been like that.

Why is there such a restriction?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel font size and ClampContent
« Reply #5 on: November 03, 2013, 09:06:56 AM »
Because players embedding colors in the stuff they type is undesirable at best.

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #6 on: November 03, 2013, 01:28:58 PM »
Because players embedding colors in the stuff they type is undesirable at best.
Then why not share option into two parts - a separate color and smiles separately. For example, when you type text on Skype and want to add a smiley, if you write by hand smile he displayed as text in the input line, and if you choose from the drop down list, then it is inserted as a string as a picture. May make a separate tag [smile] [-] and then the text would be interpreted as a picture, or else as text?
For chat inputs sometimes it's good when emoticons are displayed in the input line, at least not right away but after a certain box in Skype

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #7 on: November 05, 2013, 10:13:58 AM »
So what do you think about this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel font size and ClampContent
« Reply #8 on: November 05, 2013, 12:14:27 PM »
Right now? Nothing. Too busy... In the future, may make sense.

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #9 on: November 05, 2013, 01:08:51 PM »
Okay ;)

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #10 on: November 06, 2013, 12:08:49 AM »
Hi!
I did not create a new topic, noticed:

1. Open Chat Example.
2. Input string: "123123123]"
3. What you see on the output: "12"

I think it should not be.

Previously, I created a topic about creating separate tags for emoticons.
For example may be a situation:
I have emoticons with sequences "]:)" and ":["
Eg text: "hello my phone number :[123123]:)" will be interpreted incorrectly. Of course, you can format the text you type after sending.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel font size and ClampContent
« Reply #11 on: November 06, 2013, 07:30:50 AM »
Confirmed, thanks. I've fixed it in the repository, so you will see the fix in the next update.

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: UILabel font size and ClampContent
« Reply #12 on: November 06, 2013, 07:49:06 AM »
Confirmed, thanks. I've fixed it in the repository, so you will see the fix in the next update.

I do my little chat for the game, and how many had to dig in NGUI (UIInput, UILabel, ScrollBars, Clipped Panels etc) :)