Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以编程方式检查 NSFont 是否包含像“°”这样的 unicode 字符?
好的,试试这个:
NSFont *font = [NSFont fontWithName:@"Arial" size:14.0]; NSCharacterSet *set = [font coveredCharacterSet]; if (![set characterIsMember:[@"°" characterAtIndex:0]]) { NSLog(@"Failed"); } else { NSLog(@"Success"); }