• 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 woes, the next chapter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text woes, the next chapter


  • Subject: Re: text woes, the next chapter
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 3 Dec 2004 09:32:17 -0800


On Dec 3, 2004, at 7:32 AM, Robert Clair wrote:


It can be coded around - getting the range of glyphs for each line (minus the line end
character[s]), using boundingRectForGlyphRange:inTextContainer: for each line
range and then unioning the resulting rects seems to work, but it would be nicer
if the layout manager routines behaved more sensibly. Any suggestions as to
what might be causing this would be appreciated.

This is essentially what is done already when you call boundingRectForGlyphRange:inTextContainer: for the whole range of glyphs in the container, so it would be useful if you could come up with a small stand-alone reproducible example of this.



Another annoyance -

I'm turning my glyphs into paths at one point, using

glyph = [nyLayoutManager glyphAtIndex: glyphIndex];
[path appendBezierPathWithGlyphs: &glyph count: 1 inFont: aFont];

This produces random trash glyphs (mostly boxes, but cute negative space question
marks for Zapafino). On investigation the reason is that this code puts out glyph = 0
after ligatures. For example in Times an "fl", which is advertised as being two characters
and one glyph (the ligature) comes out as two glyphs - the glyph for the ligature and
glyph 0. This is easy enough to filter out, but, again, is there some reason for this behavior ?

The glyph generator and layout manager reserve the right to insert NSNullGlyph as padding in the glyph stream. In practice they do so in cases such as ligatures where the number of glyphs is smaller than the number of characters. The use of padding in this case allows the layout manager to maintain identity between glyph and character indexes, which is a significant performance improvement. Please file a bug if you find that NSBezierPath is not handling this correctly--it may be that there is an issue with the case of a single isolated null glyph.


Douglas Davidson

_______________________________________________
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: 
 >text woes, the next chapter (From: Robert Clair <email@hidden>)

  • Prev by Date: Re: SuperScript to baseline offset
  • Next by Date: NSString initWithData: NSUTF8StringEncoding - returns 'nil'
  • Previous by thread: text woes, the next chapter
  • Next by thread: Different versions of framework?
  • Index(es):
    • Date
    • Thread