• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView Linked Text Font Attribute Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView Linked Text Font Attribute Issues


  • Subject: Re: NSTextView Linked Text Font Attribute Issues
  • From: Robb Albright <email@hidden>
  • Date: Sat, 29 Dec 2007 14:05:24 -0800

On Dec 28, 2007, at 12:01 PM, email@hidden wrote:

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.

<snip>


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];



The key "NSFontNameAttribute" should be set to an NSString instance (the font name), not an NSFont instance.


So, for the first attribute key, instead of:

[NSFont fontWithName: @"Monaco" size: 12.0], NSFontNameAttribute,


use:

@"Monaco", NSFontNameAttribute,


Any help would be greatly appreciated!


hope this helps.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
robb albright
software engineer – Macintosh and cross-platform
email@hidden
Vernier Software & Technology
beaverton, or
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



_______________________________________________

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


  • Follow-Ups:
    • Re: NSTextView Linked Text Font Attribute Issues
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Getting NSArrayController content after application launch
  • Next by Date: Re: NSTextView Linked Text Font Attribute Issues
  • Previous by thread: Re: Getting NSArrayController content after application launch
  • Next by thread: Re: NSTextView Linked Text Font Attribute Issues
  • Index(es):
    • Date
    • Thread