On 2 Jan 2011, at 1:23 PM, George Nachman wrote: > I'm using CGContextShowGlyphsWithAdvances to render fixed-width text > because it is very fast. If a glyph is missing, I use > CTFontCreateForString() to pick a better font, and that usually works. > I ran into a case that I just can't solve with this technique [...]
Do you need layout+rendering to be fast, or just rendering? If the latter, for example if you're drawing a fixed string multiple times, you could use a higher level routine to do the layout (e.g. CTTypesetterCreateLine() or CTLineCreateWithAttributedString()) and then extract the glyphs, offsets, so on from the typeset line to draw with CGContextShowGlyphsWithAdvances(). (Actually I'd be surprised if CGContextShowGlyphsWithAdvances() is much faster than CTLineDraw() --- I'd guess that simply caching the typeset line will get you most of the available speedup.) _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com