Core Animation and Anti Aliased Fonts on the Mac

2019-04-29 12:50发布

I'm trying to create a view that is backed by a Core Animation layer. However, when I enable the layer, my labels start to look slightly jagged. I've attached a demonstration of difference:

Excluding Core Animation Layer Including Core Animation Layer

I know it is subtle, but it is driving me crazy (especially for smaller fonts). Any way I can get the Core Animation layer labels to be anti-aliased?

1条回答
聊天终结者
2楼-- · 2019-04-29 13:19

Nitpick: the Core Animation layer is anti-aliased, but at a lower quality – it doesn’t use sub-pixel anti-aliasing. The reason for this is that sub-pixel anti-aliasing requires per-channel blending, which can’t be done cheaply with hardware compositing.

The example linked from here demonstrates various ways of working around this problem.

查看更多
登录 后发表回答