I am doing a Fo开发者_StackOverflownt application for the Mac. I got all the font names from the location "/Library/Fonts/" and saved them in an array named FontArray. I just have to preview all the fonts in a NSTextView. This is my code for the NSTextView:  
NSTextView *textView=[[NSTextView alloc]initWithFrame:NSMakeRect(250,500,450,30)];
[textView setString:@"ABCDEFGHIJKLMMOPQRSTUVWXYZ"];
[textView setFont:[NSFont fontWithName:[FontArray objectAtindex:rowid] size:40]];  
This function will be called when a tableview row has been clicked. This works correctly for all the english fonts. But whenever non english fonts clicked means it gives an error like            *** -[NSTextView setFont:]: nil NSFont given. How can I change my code to correct this error.      
You're on a completely wrong road. A font is not a font file; the name of the font contained inside a font file is not necessarily the same as the name of the file, as you've discovered. Instead of trying to work with the font files directly, use NSFontManager.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论