문제

how could I check programmatically whether a NSFont contains a unicode character like '°'?

도움이 되었습니까?

해결책

Ok, try this:

NSFont *font = [NSFont fontWithName:@"Arial" size:14.0];
NSCharacterSet *set = [font coveredCharacterSet];
if (![set characterIsMember:[@"°" characterAtIndex:0]]) {
    NSLog(@"Failed");
} else {
    NSLog(@"Success");
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top