• 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
Getting glyphs and their outlines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting glyphs and their outlines


  • Subject: Getting glyphs and their outlines
  • From: Steve Sims <email@hidden>
  • Date: Mon, 29 Mar 2004 12:01:00 -0500

Hi gang,

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.

Right now I'm fairly new to Mac programming, having previously been a Newton developer and spent several years away from coding. Obviously I really want to do much more than just get the outline of a single glyph - this is merely a very simple prototype to help me learn.

I have spent quite a while reading the documentation and wading through sample code and in the process I've got rather confused. There does seem to be quite a bit of sample code for text things, including an example called ATSUICurveAccessDemo which gets access to glyph data, but it seems that all of these samples are Carbon applications, and so none use the Cocoa APIs for doing equivalent things. The new "ATSUI Direct" APIs for getting glyph curves seems excessively complicated to me, so I waded through the Cocoa docs to try to find a better way.

Of course outline graphics are represented as NSBezierPath objects. Getting outlines the ATSUICurveAccessDemo way would seem to be a virtual duplication of NSBezierPath's appendBezierPathWithGlyph:inFont: call and I hate to reinvent the wheel. The only problem is this call takes an NSGlyph, and I can't see how to get the glyph for a particular character. I've looked everywhere I can think this would be, like NSGlyph, NSFont, NSString, etc., but haven't found it. I'm probably overlooking the obvious...

So my question is simply how do I, in a Cocoa-friendly manner, get a glyph for a single character?

Steve
_______________________________________________
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.


  • Follow-Ups:
    • Re: Getting glyphs and their outlines
      • From: Glenn Andreas <email@hidden>
    • Re: Getting glyphs and their outlines
      • From: Allan Odgaard <email@hidden>
    • Re: Getting glyphs and their outlines
      • From: Nicko van Someren <email@hidden>
    • Re: Getting glyphs and their outlines
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Decoding HTML Entities
  • Next by Date: Re: Decoding HTML Entities
  • Previous by thread: Re: Decoding HTML Entities
  • Next by thread: Re: Getting glyphs and their outlines
  • Index(es):
    • Date
    • Thread