• 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: Creating an NSTypeSetter Subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating an NSTypeSetter Subclass


  • Subject: Re: Creating an NSTypeSetter Subclass
  • From: Seth Willits <email@hidden>
  • Date: Mon, 4 Dec 2006 17:42:53 -0800

On Dec 4, 2006, at 10:47 AM, Douglas Davidson wrote:

Are there any examples of how to write a custom NSTypeSetter? I'm rather lost, to be honest.

The override points, and the difficulty of the project, depend quite a bit on what it is that you want to do. NSTypesetter and NSATSTypesetter have many predefined override points for various tasks, and you should look through their documentation to see whether one or a combination of these will suit your needs. It is also possible to write a complete custom typesetter from scratch, but I don't really recommend it.

Yeah, I'm not sure what I can reuse and what I can't. I don't fully understand which methods are required for actual layout which are accessors or for convenience.



I've appended the code from an example I presented at WWDC 2003. This is part of a larger example; the typesetter portion was intended to increase the line spacing at certain points in the text where necessary to accommodate annotations above or below the text.

I should have gone to that session. Any chance that I could get a hold of this example? Looks really neat.



The big thing I'm wanting to do is optimize layout for fixed width fonts. Correct me if I'm wrong, but there's a huge amount of speed to be garnered by having a custom typesetter making assumptions about character width and height. A really large file in a text view with lines that wrap is veeeery slow to layout with the default classes.



Thanks,


-- Seth Willits



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Creating an NSTypeSetter Subclass (From: Seth Willits <email@hidden>)
 >Re: Creating an NSTypeSetter Subclass (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Synchronizing Thread Execution
  • Next by Date: selecting specific field in a textual NSDatePicker
  • Previous by thread: Re: Creating an NSTypeSetter Subclass
  • Next by thread: nscombobox and nextkeyview
  • Index(es):
    • Date
    • Thread