Doing NSStringDrawingTruncatesLastVisibleLine with NSLayoutManger
Doing NSStringDrawingTruncatesLastVisibleLine with NSLayoutManger
- Subject: Doing NSStringDrawingTruncatesLastVisibleLine with NSLayoutManger
- From: Eric Gorr <email@hidden>
- Date: Wed, 4 Mar 2009 16:57:28 -0500
I am drawing a string with a NSLayoutManager by doing:
[layoutManager drawGlyphsForGlyphRange:glyphRange
atPoint:NSMakePoint( [self bounds].origin.x,[self bounds].origin.y )];
What I would like is if the string I am drawing goes beyond the last
visible line, is for the string to draw a truncated form of itself
with an elipses at the last visible part of the string.
As near as I can tell, this is what the NSString drawing option
NSStringDrawingTruncatesLastVisibleLine will do.
The paragraph style NSLineBreakByTruncatingTail comes close, but I
have a single string that can be drawn over multiple lines and still
be visible. The NSLineBreakByTruncatingTail style restrict my drawing
to just a single line which isn't enough.
Anyone tried to emulate NSStringDrawingTruncatesLastVisibleLine with
NSLayoutManager drawing?
Is there any sample code out there demonstrating the technique?
_______________________________________________
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