How do you underline text ?
How do you underline text ?
- Subject: How do you underline text ?
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 18 Jun 2001 18:38:20 +0200
I'm doing this little thing in a Custom View:
+ (NSDictionary *) sharedFontAttributes
{
static NSDictionary * sharedFontAttributes_=nil;
if (!sharedFontAttributes_)
{
NSMutableParagraphStyle * tParagraphStyle;
tParagraphStyle=[[NSMutableParagraphStyle alloc] autorelease];
[tParagraphStyle setParagraphStyle:[NSMutableParagraphStyle
defaultParagraphStyle]];
[tParagraphStyle setAlignment:NSLeftTextAlignment];
sharedFontAttributes_=[[NSDictionary
dictionaryWithObjectsAndKeys: [NSFont labelFontOfSize:[NSFont
smallSystemFontSize]], NSFontAttributeName,
[NSColor blueColor],NSForegroundColorAttributeName,
NSSingleUnderlineStyle,NSUnderlineStyleAttributeName,
tParagraphStyle, NSParagraphStyleAttributeName,nil] retain];
}
return sharedFontAttributes_;
}
and this:
- (void)drawRect:(NSRect)rect
{
/**/NSRect tRect=[self frame];
tRect.origin=NSZeroPoint;
NSLog(title_);
[title_ drawInRect:tRect withAttributes:[MyView
sharedFontAttributes]];
}
and yet the text is not drawn underlined (it's blue, it's left aligned) !
Any great idea. Because the documentation on that topic says discussion
and description forthcoming. Could be cool to have them today.