• 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 orientation/positioning with layout manager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text orientation/positioning with layout manager


  • Subject: Re: text orientation/positioning with layout manager
  • From: Aki Inoue <email@hidden>
  • Date: Mon, 31 Jan 2011 15:23:52 -0800

The precise definition of the point specified by the argument is the top left corner of the text container containing the glyph range in the focused view coordinate system.

Aki

On Jan 31, 2011, at 3:18 PM, Graham Cox wrote:

>
> On 01/02/2011, at 9:09 AM, Todd Heberlein wrote:
>
>> I'm doing a simple experiment using NSTextStorage, NSLayoutManager, NSTextContainer to draw some text (I am basing this on the CircleView example because I want some of that orientation power later).
>>
>> I have found that when rendering the text using drawGlyphsForGlyphRange:atPoint:, I don't get the text where I expected. It is higher than I expect. Furthermore, when I draw a rectangle around the text (or try to) using the rectangle from usedRectForTextContainer:, the text is outside the rectangle (in short, the rectangle is where I expect it to be, but the text glyphs are not).
>>
>> Is there a secret incantation that I am missing?
>
>
> One thing that caught me out at first was that text is laid out based on the top, left of the glyph's bounding box, not on some notional baseline. The glyphs are positioned so that the baselines line up, but this is done by offsetting the top edge of the bbox. So if you assume that it's the baseline you're setting, text will be placed generally higher than expected. Is that what's happening?
>
> --Graham
>
>
> _______________________________________________
>
> 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

_______________________________________________

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: text orientation/positioning with layout manager
      • From: Todd Heberlein <email@hidden>
References: 
 >text orientation/positioning with layout manager (From: Todd Heberlein <email@hidden>)
 >Re: text orientation/positioning with layout manager (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: text orientation/positioning with layout manager
  • Next by Date: Re: worker thread iterating over array - SLOW
  • Previous by thread: Re: text orientation/positioning with layout manager
  • Next by thread: Re: text orientation/positioning with layout manager
  • Index(es):
    • Date
    • Thread