• 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: Text height for printing (fixed width)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text height for printing (fixed width)


  • Subject: Re: Text height for printing (fixed width)
  • From: email@hidden
  • Date: Tue, 3 Jan 2006 22:22:54 -0800


Aki Inoue wrote:
Jérôme,

What you (and others) are observing here is the typesetter behavior difference between measurement and rendering.

You're using one of string drawing convenience to render text, but using NSLayoutManager for measurement.

Currently the string drawing convenience methods defined in NSStringDrawing.h are using NSTypesetterBehavior_10_2_WithCompatibility whereas the default setting for NSLayoutManager is NSTypesetterLatestBehavior.

This causes line height calculation mismatch.

A easy solution for your problem is to add the following line in - heightForStringDrawingV1:withFont:andWitdh:.
[layoutManager setTypesetterBehavior:NSTypesetterBehavior_10_2_WithCompatibility];


Ideally, you should use the same layout manager you used to measure for rendering (especially for performance).

Aki
This is the exact problem I was having as well. Thanks too.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Text height for printing (fixed width) (From: Jérôme Jaglale <email@hidden>)
 >Re: Text height for printing (fixed width) (From: Aki Inoue <email@hidden>)

  • Prev by Date: Re: Embedding Flash in .app, Round Two
  • Next by Date: Re: insertText
  • Previous by thread: Re: Text height for printing (fixed width)
  • Next by thread: Re: NSMatrix NSImageCell binding
  • Index(es):
    • Date
    • Thread