• 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: Overriding text size in NSTextStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding text size in NSTextStorage


  • Subject: Re: Overriding text size in NSTextStorage
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 10 May 2010 08:50:13 -0700

On May 10, 2010, at 4:54 AM, Gideon King wrote:

> Hi, I am trying to override the setting of text size in my text storage subclass. I have overridden the setAttributes:range: method, and told the text to use a standard font size (keeping the other font attributes), but when I am editing, and use the font panel to set the font, although the correct font size is used, the text is moved up or down depending on the size of the font selected.

That sounds like a dangerous thing to do — you’re violating the expected behavior of the class (i.e. what goes in is the same as what comes out.)

If you want to alter the characteristics of the text, you should do so before it goes into the text view, or in one of the explicit NSTextView delegate hooks. I’m pretty sure at least one delegate call allows you to alter the text (including its style) that’s about to be inserted.

—Jens_______________________________________________

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: Overriding text size in NSTextStorage
      • From: Gideon King <email@hidden>
References: 
 >Overriding text size in NSTextStorage (From: Gideon King <email@hidden>)

  • Prev by Date: Re: self = [super init], nil?
  • Next by Date: RE: Problem mac os X version 10.6 when using sprinft
  • Previous by thread: Overriding text size in NSTextStorage
  • Next by thread: Re: Overriding text size in NSTextStorage
  • Index(es):
    • Date
    • Thread