Согласно документации, можно включить шрифт сглаживание внутри CATextLayer:
Text can only be drawn using sub-pixel antialiasing when it is composited into an existing opaque background at the same time that it's rasterized.
Вот как я понимаю эту фразу:
@implementation CATextLayerWithFontSmoothing
-(id)init {
self=[super init];
if (self) {
CALayer * whiteBackground = [CALayer layer];
CATextLayer * blackText = [CATextLayer layer];
[whiteBackground setBounds:NSMakeRect(0, 0, 300, 300)];
[blackText setBounds:NSMakeRect(0, 0, 300, 300)];
[whiteBackground setBackgroundColor:[NSColor whiteColor].CGColor];
[blackText setForegroundColor:[NSColor blackColor].CGColor];
[blackText setString:@"CATextLayer"];
[blackText setShouldRasterize:YES];
[self addSublayer:whiteBackground];
[self addSublayer: blackText];
}
return self;
что не работает. Текст не рисуется с использованием субпиксельного сглаживания.
[blackText setBackgroundColor:[NSColor whiteColor].CGColor]
- person rob mayoff   schedule 10.02.2013