Re: Subclassing NSLayoutManager
Re: Subclassing NSLayoutManager
- Subject: Re: Subclassing NSLayoutManager
- From: Charles Srstka <email@hidden>
- Date: Mon, 24 Feb 2003 15:46:41 -0600
On Monday, February 24, 2003, at 01:36 PM, Douglas Davidson wrote:
On Monday, February 24, 2003, at 10:45 AM, Charles Srstka wrote:
Yeah, that's what I figured. Actually, that's what I'm using right
now - a custom NSTypesetter using replaceGlyphAtIndex:withGlyph:. The
trouble is, the performance of my typesetter seems to be not as good
as the default typesetter, and I figured that I might be able to help
things a bit if I could override the part of NSLayoutManager that
generates the glyphs, so they would just be generated once instead of
first generating the default glyph, and then replacing it with a new
glyph that it has to generate *again*.
Well, in practice the glyph generation time is usually small compared
to the layout time, so that may not be the issue. There is the issue,
though, that if glyphs are externally modified in this way, the layout
manager does have to do some extra storage and extra invalidation
under some circumstances. I don't think you can get around that at
this point.
I was actually hoping that by subclassing NSLayoutManager or
NSGlyphInfo or whatever that I could get around having to use an
NSTypesetter subclass and just use the default one instead as it seems
to be a lot more optimized than the quick typesetter I was able to hack
together.
I'll have a look at NSGlyphInfo. Is it possible to use this to return
multiple glyphs for a character that usually maps to only one glyph,
or can I only return the same number of glyphs that would usually be
mapped?
I believe you can supply a single glyph for multiple characters, but I
don't think you can supply multiple glyphs for a single character.
Darn, so the only way to do this is to use -[NSLayoutManager
insertGlyph:atGlyphIndex:characterIndex:] ?
Charles
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.