| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
There, in theory, exist fonts that setShowsInvisibleCharacters works, but I've never found one (it's suppose to be a capability of the font), so subclassing NSLayoutManager is the cleanest way to do this.
Something like this:
- (void)drawGlyphsForGlyphRange:(NSRange)glyphRange
atPoint:(NSPoint)containerOrigin
[snip]
You can check out some complete workable code at
http://smultron.sourceforge.net (the SMLLayoutManager class).
Unfortunately, the above code doesn't quite work correctly, since characterAtIndex: is a character based index, and you are going through glyph based indices. Now while these two are usually the same (and the layout manager will insert null-glyphs to help maintain this), there is no guarantee that it will be the same, and so you should convert the glyph index to character index.
The original poster could use IDEKit (http://projects.gandreas.com/idekit) and just drop in a view that provides this capability (and a boatload of others).
_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden This email sent to email@hidden
| References: | |
| >Invisible characters in NSTextView (From: Jean Bovet <email@hidden>) | |
| >Re: Invisible characters in NSTextView (From: Peter Borg <email@hidden>) | |
| >Re: Invisible characters in NSTextView (From: glenn andreas <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.