• 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: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?


  • Subject: Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
  • From: Stéphane Sudre <email@hidden>
  • Date: Wed, 9 Jul 2008 01:16:46 +0200


On Jul 9, 2008, at 12:53 AM, Douglas Davidson wrote:


On Jul 8, 2008, at 3:44 PM, Stéphane Sudre wrote:

What I mean by incorrect value is that if I draw the string inside a rectangle whose width is inMaxWidth and height is the value obtained from the rect returned by usedRectForTextContainer:, the last line of the string is clipped outside the rectangle. And the difference increases with the number of lines.

Most likely you are dealing with a mismatch between the way you are measuring and the way you are drawing, probably a difference in the typesetterBehavior. Typesetter behavior issues have been discussed on the lists a number of times; try searching the archives.

I was going to write that using [myUncooperatingLayoutManager setTypesetterBehavior:NSTypesetterBehavior_10_2_WithCompatibility]; didn't change anything but apparently, you have to call it before glyphRangeForTextContainer:.


It could be worth a Technote or a QA on the ADC website IMHO (if these things still exist).

Thanks a lot.


_______________________________________________

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


References: 
 >[NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Stéphane Sudre <email@hidden>)
 >Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Stéphane Sudre <email@hidden>)
 >Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Stéphane Sudre <email@hidden>)
 >Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Why aren't my bindings firing?
  • Next by Date: Quick look preview multipage rich text
  • Previous by thread: Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
  • Next by thread: Package data store for app with agents
  • Index(es):
    • Date
    • Thread