• 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: Faster text drawing with configurable stroke width
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster text drawing with configurable stroke width


  • Subject: Re: Faster text drawing with configurable stroke width
  • From: Ken Ferry <email@hidden>
  • Date: Wed, 16 Mar 2011 21:55:26 -0700

On Sun, Mar 13, 2011 at 3:03 PM, George Nachman <email@hidden> wrote:

> Hi cocoa-dev,
>
> I'm currently drawing text one character at a time with
> -[NSAttributedString
> drawWithRect:options:], and it is really slow. I'm looking for a faster
> alternative.
>
> I draw one character at a time because I need exact control over horizontal
> positioning (regardless of whether the font is monospaced or not, I force
> characters onto a grid--this is non-negotiable) and I'm not aware of
> another
> way to achieve this that also supports my second requirement:
>
> I am using  -[NSAttributedString drawWithRect:options:]
> instead CGContextShowGlyphsWithAdvances() or CTLineDraw() because it
> supports NSStrokeWidthAttributeName.


Have you looked at CGContextSetTextDrawingMode and CGContextSetLineWidth?


> It also does a nice (but not as nice a
> NSTextView) job at rendering combining marks.
>
> My performance troubles are significant when there is a substantial amount
> of new text, so caching layouts would do me little good. I suspect there
> might be something lurking in NSLayoutManager/NSTypesetter/etc. that can
> help me, but I haven't found it.
>
> Thanks for your help,
> George
> _______________________________________________
>
> 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
>
_______________________________________________

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

References: 
 >Faster text drawing with configurable stroke width (From: George Nachman <email@hidden>)

  • Prev by Date: Re: Faster text drawing with configurable stroke width
  • Next by Date: about keystrokes out of the window
  • Previous by thread: Re: Faster text drawing with configurable stroke width
  • Next by thread: How hidden the Keyboard in a UIWebView
  • Index(es):
    • Date
    • Thread