In a new TextEdit "Wrap to Page" document, change the font to Zapfino and type 
a lowercase f. The left swash is cut off. I would like to draw the entire 
glyph, as Pages does (and I am aware that Pages does not use NSTextView).

It's easy enough to draw the entire glyph by sending -lockFocus to the 
NSTextView's superview before the NSLayoutManager sends 
drawGlyphsForGlyphRange:atPoint:. The problem is determining what part of the 
superview needs to be redrawn when the glyph is moved or deleted.

NSLayoutManager boundingRectForGlyphRange:inTextContainer: is supposed to 
"determine the area that contains all drawing performed for a range of glyphs." 
However, the rect it returns does not include the complete area drawn by the 
glyph (the method returns a width of 6.5, while the width of the glyph is 
38.87, as determined by NSFont -boundingRectForGlyph:). 

Is there a way to determine the rect or rects actually drawn by 
drawGlyphsForGlyphRange:atPoint:? Or, is there a better approach to insuring 
that all parts of every glyph are drawn?

-Ross
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to