I would like to use interface builder to display text in an NSTextField, which I can do. But when the text is too long to fit normally in the space provided in the interface builder layout, I need to be able to constrain in. I see the width constraint on the NSTextField, but it dent' behave exactly as I need. I need to display the entire string, but to squeeze the font horizontally such that it compresses the string into the available space. Is there a way to do this?
Asked
Active
Viewed 281 times
0
-
You can change the font size in IB, until it fits, but unless it's only a little too long, the font will be ridiculously small. – rdelmar Jun 06 '12 at 03:41
-
What I need do do is adjust only the width, leaving the height alone. For this, I don't think adjusting the font size will help. Is there another way to do this? – Adam Jun 06 '12 at 11:29
-
No, I don't know any way to do that, but even if you could, you would run into the problem of the text being so distorted that it would be hard to read. – rdelmar Jun 07 '12 at 06:16
-
The standard way of handling the case that you have mentioned above is to truncate the string. – Suhas Jun 08 '12 at 11:07