- briksoftware Blog - https://briksoftware.com/blog -

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.