문제

According to the documentation, you should set an <NSFontManagerDelegate> to the shared instance of NSFontManager. The delegate should implement a method

- (BOOL) fontManager:(id)sender willIncludeFont:(NSString *)fontName;

which will then be called repeatedly. Unfortunately, there is no documentation of <NSFontManagerDelegate> available, and in fact the protocol is missing. All the same, I created an instance of NSObject that implements the method mentioned above, and set it as a delegate of NSFontManager. Unfortunately, the method is never called. After some googling, I learned that fontManager:willIncludeFont: is deprecated since OS X 10.3.

Is there any alternative? What should I do if my application only supports mono-spaced fonts?

도움이 되었습니까?

해결책

subclass NSFontManager, override - (NSArray *)collectionNames, return a list of font collections.[1]

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top