Re: Glyph from Character
Re: Glyph from Character
- Subject: Re: Glyph from Character
- From: Douglas Davidson <email@hidden>
- Date: Wed, 21 Mar 2007 11:56:03 -0700
On Mar 21, 2007, at 11:27 AM, Gordon Apple wrote:
Simple question, to which I've found a multitude of
ridiculously complex
answers in the archives. I just want the Bezier path of a
character, e.g.,
"A", "?", "&".
[path appendBezierPathWithGlyph:(NSGlyph)something(@"A")
infont:[NSFont systemFontOfSize:400];
There must be a simple function "something" that will map the
glyph
index of a given character. What is it?
The problem is that it's not a simple question. NSGlyphGenerator
maps characters to glyphs, but in general the mapping is many-to-many
and context-dependent; to obtain a correct mapping of characters to
glyphs, use an NSLayoutManager and let it perform layout, then ask it
for the glyphs.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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