> 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)
Without knowing your exact requirements, I can't say if this technique meets them (or is faster than what you're already doing), but you might try rigging up an NSTextStorage where each composed character sequence is separated by a tab character. To achieve the exact spacing you'd also apply an NSParagraphStyle with corresponding center-aligned uniformly-spaced NSTextTabs. Then just let NSLayoutManager do all the drawing for you all at once. ~Martin _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
