问题描述
我试图创建一个由Core Animation层支持的视图。但是,当我启用图层,我的标签开始看起来有点锯齿。我附上了一个差异演示:
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:
我知道这是微妙的,但它是驱使我疯了(特别是对于较小的字体)。
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?
推荐答案
Nitpick:核心动画层是反向别名的, aliased,但是质量较低 - 它不使用子像素抗锯齿。这是因为子像素抗锯齿要求每通道混合,这不能通过硬件合成廉价地完成。
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.
这篇关于Core上的核心动画和抗锯齿字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!