CATextLayer is blurry on non-retina display

33 Views Asked by At

On a non-retina display (Mac), my CATextLayer instances produce text that is blurrier than what I get with NSAttributedString's -drawAtPoint:

See for yourself:

enter image description here

At the top, a CATextLayer instance (contentsScale property is 1.0, which corresponds to the screen's pixel density), at the bottom, the result of NSAttributedString's -drawAtPoint:. Both use the same font and colour.

Changing the allowsFontSubpixelQuantization property of CATextLayer doesn't make any noticeable difference.

If I set the layer's contentsScale to 2.0, the text becomes sharper. But there may be something I missed, because I'm not supposed to set this to 2.0 on a non-retina display, am I?

Note: on a retina display, the difference in sharpness is also noticeable, but less so.

This is on macOS 12.

0

There are 0 best solutions below