Custom line breaking in NSTextView
Custom line breaking in NSTextView
- Subject: Custom line breaking in NSTextView
- From: email@hidden (Stefan Haller)
- Date: Tue, 26 Jul 2005 13:29:52 +0200
- Organization: Ableton
(I seem to remember that this has been discussed before, a couple of
years ago, but without a satisfactory solution; and I can't find the
thread in the archives right now.)
I would like to customize the line breaking in an NSTextView in such a
way that it doesn't wrap at the window width, but after a certain number
of characters, say 72. Any suggestions how to go about this?
I suspect that one solution might be to sub-class NSATSTypesetter and
override
layoutGlyphsInLayoutManager:
startingAtGlyphIndex:
maxNumberOfLineFragments:
nextGlyphIndex:
but that seems like a lot of work to me (if I can figure out at all what
exactly I have to do in my overridden method).
Any pointers (especially at sample code) would be much appreciated.
--
Stefan Haller
Ableton
http://www.ableton.com/
_______________________________________________
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