Re: Rendering combining marks
Re: Rendering combining marks
- Subject: Re: Rendering combining marks
- From: Wim Lewis <email@hidden>
- Date: Mon, 3 Jan 2011 13:47:07 -0800
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 (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