Re: Problem with CircleView Example and NSLayoutManager angles...
Re: Problem with CircleView Example and NSLayoutManager angles...
- Subject: Re: Problem with CircleView Example and NSLayoutManager angles...
- From: Douglas Davidson <email@hidden>
- Date: Thu, 29 Jan 2004 18:32:45 -0800
On Jan 29, 2004, at 6:00 PM, Steve Mykytyn wrote:
well, i was careful to write "glyph" rather than "character"
throughout - so i think a text newbie can be forgiven for saying
"last" rather than "rightmost" - but that raises another question.
The proposed solution worked great for left to right text:
usedRect.origin.x + usedRect.size.width - [textContainer
lineFragmentPadding];
But would it work for anything else? I think up to the last glyph
that averaging the angles between the starts of two glyphs to get the
correct orientation of the first glyph will work whichever direction
you go. But won't the solution above fail for right to left? Should
it be just [textContainer lineFragmentPadding] for the leftmost point
of the leftmost glyph?
Bidi text is hard, there's just no two ways about it. The problem is
that you simply can't assume that two glyphs that are adjacent
logically will be adjacent visually. If you intend to support bidi
text and wish to do something like this solely with the information
maintained by the layout manager, then effectively what you want to do
is sort the glyph runs in the fragment into visual order and work with
those. That's not too difficult conceptually, but writing an efficient
implementation is not so simple. If you do continue along these lines,
I'd love to see it.
For even more bonus points, why doesn't "boustrophedon" return any
results in a search on Apple Support?
Currently we support only horizontal line fragments ordered generally
from top to bottom of the page. Within those fragments the glyphs are
ordered visually according to the bidi algorithm. There are a number
of other layout styles that are on our list for potential future
support, but I don't think boustrophedon has made it there yet...
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.