NSTextView Linked Text Font Attributes Issues
NSTextView Linked Text Font Attributes Issues
- Subject: NSTextView Linked Text Font Attributes Issues
- From: "Oliver Kurek" <email@hidden>
- Date: Fri, 28 Dec 2007 12:58:55 -0500
I'm having issued with a subclassed NSTextView displaying linked text
as I'd like it to. The link text attributes I specify are working,
except for the font name attribute. The link text appears to be
rendered in the Helvetica font, while my default attributes call for
Monaco.
The text is attributed using the NSLinkAttributeName attribute with a
custom link object and handled by the subclass through the
-textView:clickedOnLink:atIndex: delegate.
I've implemented -linkTextAttributes in the subclass, which returns an
NSDictionary with keys for NSForegroundColorAttributeName,
NSBackgroundColorAttributeName, NSUnderlineStyleAttributeName,
NSCursorAttributeName and NSFontNameAttribute.
myDefaultLinkTextAttributes =
[[NSDictionary alloc] initWithObjectsAndKeys:
[NSFont fontWithName: @"Monaco" size: 12.0], NSFontNameAttribute,
[NSColor lightGrayColor], NSForegroundColorAttributeName,
[NSColor clearColor], NSBackgroundColorAttributeName,
[NSNumber numberWithInt: NSUnderlineStyleNone], NSUnderlineStyleAttributeName,
[NSCursor pointingHandCursor], NSCursorAttributeName,
nil];
I've read through as much of the documentation as I could find
pertaining to linked text, attributed string, text views, etc.,
without much luck at all.
Any help would be greatly appreciated!
Thanks,
Oliver Kurek
_______________________________________________
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