• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting glyphs and their outlines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Getting glyphs and their outlines (From: Steve Sims <email@hidden>)

  • Prev by Date: Re: Getting glyphs and their outlines
  • Next by Date: Re: Photoshop bug,while importing images - Is anyone from Apple listening?
  • Previous by thread: Re: Getting glyphs and their outlines
  • Next by thread: Re: Getting glyphs and their outlines
  • Index(es):
    • Date
    • Thread