Re: NSFont for glyph
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