NSFont fontNamed:@”Arial”

Using fonts in a drawing method should be a pretty common thing. I use that in CuteClips for rendering the text of each clip. However, one should not believe that [NSFont fontNamed:(NSString*)aFontName] is sort of appropriate for using it there. This method is hell slow. If you’re going to draw some NSString instances with special attributes, you should really use caches for the font. The speedup is quite reasonable.

2 Responses to “NSFont fontNamed:@”Arial””

  1. Robert 'Groby' Blum Says:

    The main problem is of course that you use Arial 😉

  2. Karsten Says:

    yeah, you’re right… but i only use this font for the small numbers that show the shortcut of a clip 😉 the rest is drawn using the beautiful lucida grande 😀