• 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: Rendering combining marks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Rendering combining marks
      • From: George Nachman <email@hidden>
References: 
 >Rendering combining marks (From: George Nachman <email@hidden>)

  • Prev by Date: Re: When adding Cocoa classes I get a lot of compile errors automatically
  • Next by Date: Re: When adding Cocoa classes I get a lot of compile errors automatically
  • Previous by thread: Rendering combining marks
  • Next by thread: Re: Rendering combining marks
  • Index(es):
    • Date
    • Thread