Re: Subclassing NSLayoutManager
Re: Subclassing NSLayoutManager
- Subject: Re: Subclassing NSLayoutManager
- From: Charles Srstka <email@hidden>
- Date: Mon, 24 Feb 2003 12:45:38 -0600
On Monday, February 24, 2003, at 11:56 AM, Douglas Davidson wrote:
On Sunday, February 23, 2003, at 5:42 PM, Charles Srstka wrote:
I'm wondering what NSLayoutManager's primitive methods are for
looking up the glyph(s) that correspond to a character. I'd like to
subclass it and cause some characters to sometimes map to different
glyphs. NSLayoutManager has quite a lot of methods pertaining to
looking up glyphs - which are the ones I should override?
We do not yet really have a public interface for glyph generation.
However, it is possible to tell the layout manager to use one glyph or
another, via the primitives for adding and removing glyphs, e.g.
replaceGlyphAtIndex:withGlyph:. These methods should be used with
some care; typically they are called after glyph generation has
already been performed, for example by the typesetter during layout.
You may find it more convenient to use the NSGlyphInfoAttributeName
attribute, which allows full control over the glyph to be used at the
attribute level. See NSGlyphInfo.h for more information.
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*.
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?
Thanks,
Charles Srstka
_______________________________________________
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.