Re: Underlining text in Interface Builder
Re: Underlining text in Interface Builder
- Subject: Re: Underlining text in Interface Builder
- From: Jonathan Hess <email@hidden>
- Date: Tue, 4 Nov 2008 12:09:39 -0800
Hey Adil -
A text label in Interface Builder is an NSTextField, which has an
NSTextFieldCell. NSTextFieldCell has three related properties,
stringValue, font, and attributedStringValue. When the cell has just a
stringValue, and a font, it combines the two during drawing to draw
the string with the specified font. An attributed string is a much
richer combination of a string and styling directives, when a text
field cell has a specified attributed string value, it will use that
for drawing. Even though the underlining attribute is present on the
font panel, it isn't actually a property of fonts. Instead,
underlining is an attribute that you can specify for a range of
characters in an attributed string independent of the font. In order
to have a NSTextField/NSTextFieldCell pair with underlined text, you
would need to use the attributed string instead of the simple string +
font. Unfortunately, Interface Builder only supports configuring the
string and font, not the attributed string.
I suggest filing an enhancement request at http://bugreport.apple.com/
Jon Hess
On Nov 4, 2008, at 12:37 AM, Adil Saleem wrote:
Hi,
I am trying to underline a static text in Interface Builder (through
fonts window), but it does not underline the text. I don't
understand why. Any ideas ?
Thanx
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden