Re: Glyph from Character
Re: Glyph from Character
- Subject: Re: Glyph from Character
- From: Douglas Davidson <email@hidden>
- Date: Wed, 21 Mar 2007 16:07:26 -0700
On Mar 21, 2007, at 3:50 PM, Gordon Apple wrote:
I very well understand the complexities of layout, having
written my own
text editor at one point. That's still doesn't explain why it is
so friggin
difficult to get the glyph index of a single isolated character.
This isn't
the application, but for the sake of argument lets say that I
wanted to make
a set of flash cards to help someone learn the Greek or Cyrillic
alphabet.
I need one letter at a time. I may want to frame it and put other
stuff on
the card. The point is that I only want the Bezier shape of one
big glyph,
devoid of layout context.
If you want ease of use, here is what you do: create a text view,
call setString: and setFont: on it, then ask its layout manager for
the glyph at index 0. When you use the glyph with NSBezierPath, I
suggest obtaining the font from the text view's text storage rather
than using the font you originally set, because it is always possible
that the font you supplied might not have been able to render the
character in question, in which case another font will have been
substituted for it.
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