Re: Getting glyphs and their outlines
Re: Getting glyphs and their outlines
- Subject: Re: Getting glyphs and their outlines
- From: Nicko van Someren <email@hidden>
- Date: Mon, 29 Mar 2004 19:17:12 +0100
On 29 Mar 2004, at 18:01, Steve Sims wrote:
I want to do something that I feel is fairly simple, namely get a
glyph for a character in a particular font, and then grab its outline.
...
So my question is simply how do I, in a Cocoa-friendly manner, get a
glyph for a single character?
I don't know if this is the best way but what I do is use the
glyphWithName: method of NSFont. Given a single letter this returns
the glyph for that letter but you can also give it longer strings for
the names of other glyphs, e.g.:
NSFont *fnt = [NSFont labelFontOfSize: 300];
[p appendBezierPathWithGlyph: [fnt glyphWithName: @"ffl"] inFont:
fnt];
In this example you actually get the ligature for "ffl" rather than the
individual letters.
I hope this helps,
Nicko
_______________________________________________
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.