How AppKit’s NSAttributedString(NSStringDrawing) draws the string’s glyphs

Today I catched some neat exception / assertion trace of an [NSString drawAtPoint: withAttributes:] while drawing with an invalid context. So this is is the calling sequence how Mac OS X 10.5(.6) draws an NSString internally:

CGContextSetFillColorWithColor
CGContextSetStrokeColorWithColor
CGContextSetTextMatrix
CGContextSetFont
CGContextSetFontSize
CGContextGetShouldSmoothFonts
CGContextSetFontRenderingStyle
CGContextSetTextPosition
CGContextShowGlyphsWithAdvances
CGContextSetTextPosition
CGContextShowGlyphsWithAdvances

Leave a Reply

You must be logged in to post a comment.