Re: Hiding Glyphs
Re: Hiding Glyphs
- Subject: Re: Hiding Glyphs
- From: Keith Blount <email@hidden>
- Date: Sat, 20 Jun 2009 03:12:47 -0700 (PDT)
Hi,
Sorry for being over a week late to this thread, but I'm the guy who was trying to get hidden text to work before, in the thread mentioned earlier (Martin kindly pointed me in this direction). I'm not sure why the test code archives on my site weren't decompressing, but they probably just got corrupted when I moved between servers earlier in the year. Anyway, for what it's worth, I have re-uploaded the code I had for this here:
http://www.literatureandlatte.com/misc/HiddenTextArchives.zip
This zip file contains several zip files of different stages of the test project, as I haven't had chance to go through them, and a quick glance suggests that you may need to hook up a couple of actions in IB to be able to test them properly (not sure how they became unhooked).
To be honest I abandoned trying to hide glyphs at all; I wanted to do it to hide inline comments and footnotes in my app, the same as "hidden text" works in Word, but as far as I can see the OS X text system just isn't built for this. Although the code in those archives works to an extent, exceptions still get thrown in certain circumstances because the text system just expects certain things to be there and there seems to be no way to convince it otherwise. I used one of my technical support tickets on this, and had some excellent help from Aki Inoue and another Apple developer, and the methods in the zipped projects are mostly Aki's (so thanks to them for going the extra mile in trying to help me!). But in the end, even they couldn't help me find a suitable non-crashing, non-exception-throwing solution for this, and I figured that if even the OS X text gurus at Apple couldn't come up with a solution, then I had little chance of finding one on my own.
So if you do make any progress with it, I'd love to know how you get on. (If you would like to see any of the correspondence on this with the various technical issues invovled, just e-mail me off-list and I can dig it out for you.)
All the best,
Keith
> Hello,
> I subclassed NSLayoutManager's -showPackedGlyphs:… as per Mr.
> Davidson's suggestion above and it worked marvelously, except however
> it turns out that a few of the markings I want to hide are part of
> precomposed glyphs (I guess that's what you call them). In other
> words, I have some places where two or three characters, one of which
> I want to hide, corresponds to a single glyph, as I was warned above.
> Too bad, works 95% of the time.
> I haven't really looked too much into the -setNotShownAttribute…
> suggestion, as the documentation seems to state that it should only be
> called by NSTypesetter, and I'd like to try simpler measures first, if
> possible.
> My question is, could I subclass NSGlyphGenerator and insert a
> NSNullGlyph when I encounter a mark I want to hide? Or is that going
> to freak out the type setter? Also. the documentation on -
> generateGlyphsForGlyphStorage is rather sparse. Why are the glyphIndex
> and characterIndex arguments passed as pointers? What should they be
> on return?
>
> Many thanks,
> Philip White
_______________________________________________
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