Re: Detect/Disable Font Fallbacks in NSLayoutManager
Re: Detect/Disable Font Fallbacks in NSLayoutManager
- Subject: Re: Detect/Disable Font Fallbacks in NSLayoutManager
- From: Douglas Davidson <email@hidden>
- Date: Tue, 15 Jul 2008 11:13:57 -0700
On Jul 15, 2008, at 10:54 AM, Chip Bradford wrote:
What seems to be happening is the [NSString
drawAtPoint:withAttributes:] method is happily performing font
substitution to render the missing glyphs, and [NSLayoutManager
glyphAtIndex:] method is giving me the glyphID in that fallback font
as well. However, I have no way of knowing when I'm getting back
glyphIDs from my chosen font and when I'm getting glyphIDs from the
fallback font (nor do I know what that fallback font is) so I can't
figure out how I would go about looking up the correct bounding
boxes. (I end up looking up the bounding-box for the glyphID in the
wrong font).
You can get the substituted font easily--just ask the text storage for
the value of the font attribute for the corresponding character.
However, you might be better off asking the layout manager for
geometry information rather than asking the font for the bounding
box. In general, of course, you can't assume a one-to-one
correspondence between characters and glyphs, so single-character
strings won't reproduce all of the features of general layout.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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