• 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: NSTypesetter and smart quotes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTypesetter and smart quotes


  • Subject: Re: NSTypesetter and smart quotes
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 30 Jan 2004 12:04:50 -0800

On Jan 30, 2004, at 6:58 AM, Jeremy Dronfield wrote:

Since posting the above, I've come across this article:

http://www.stone.com/The_Cocoa_Files/Smart_Quotes.html

which shows how to use the NSTextView delegate method -textView:shouldChangeTextInRange:replacementString: to implement smart-quoting behaviour. It works well. However, the article is over 2 years old and designed for 10.1 (or 10.0?). So I would still be interested in any pointers towards a way of getting smart quotes automagically from the Cocoa text architecture under Panther/Jaguar.

Andrew's article and the AAT smart quotes refer to two very different things. What Andrew is describing is a way to convert ASCII quotes to open/close quotes in the text, i.e. in the underlying string. AAT smart quotes are a font feature that allow ASCII quotes in the text to be rendered using the glyphs for open/close quotes; the underlying text is unaffected. Which of these methods is appropriate depends on your application.

If you alter the text, then you will have to write your own smart-quoting logic; you also get complete control over the logic. If glyphs for open/close quotes are not available in a particular font, another font will be substituted.

If you use AAT, you will not be able to control the logic; the font will control it. If the font does not have this special feature (and most fonts likely will not) then no smart quoting will take place. You should be able to experiment with this on Panther using the typography panel.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTypesetter and smart quotes
      • From: Jeremy Dronfield <email@hidden>
References: 
 >NSTypesetter and smart quotes (From: Jeremy Dronfield <email@hidden>)
 >Re: NSTypesetter and smart quotes (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Dragging
  • Next by Date: Re: sscanf problem
  • Previous by thread: Re: NSTypesetter and smart quotes
  • Next by thread: Re: NSTypesetter and smart quotes
  • Index(es):
    • Date
    • Thread