• 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: NSFont for glyph
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFont for glyph


  • Subject: Re: NSFont for glyph
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 5 Jan 2007 13:12:58 -0800


On Jan 5, 2007, at 12:38 PM, Richard Salvatierra wrote:

I am trying to draw an outline for an attributed String. This string has multiple fonts/colors/styles. Using a layoutManager, I can get the array of glyphs but I need to know its corresponding font in the attributed string. My understanding is that a glyph does not necessarily correspond to a character, as one character could be made up of multiple glyphs and vise versa (?)
I can draw the text using: [layoutManager drawGlyphsForGlyphRange:glyphRange atPoint:textFrameRect.origin]
But how can I stoke that text. I am going down the path of:
[bezier appendBezierPathWithGlyphs:glyphArray count:glyphCount inFont: SomeFont];

To determine the font actually used for a particular glyph, use the layout manager to determine the corresponding character index and ask the text storage for the font attribute at that index. You must ask the text storage even if you previously set the font, because font substitution may have changed it. It is quite true that characters and glyphs are not in one-to-one correspondence, but all of the glyphs used to represent a given character will be taken from a single font.


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


References: 
 >NSFont for glyph (From: Richard Salvatierra <email@hidden>)

  • Prev by Date: How do I get Lucida Grande italic into my application?
  • Next by Date: A modest uninstalling proposal
  • Previous by thread: NSFont for glyph
  • Next by thread: Panel without minimize and maximize widget
  • Index(es):
    • Date
    • Thread