Re: Visible difference in text: NSTextField vs drawInRect:
Re: Visible difference in text: NSTextField vs drawInRect:
- Subject: Re: Visible difference in text: NSTextField vs drawInRect:
- From: Navneet Kumar <email@hidden>
- Date: Wed, 12 Apr 2017 18:11:39 +0530
Hi,
Thanks for the valuable insights.
Wishes,
Navneet
> On 12-Apr-2017, at 12:42 AM, Quincey Morris <email@hidden> wrote:
>
> On Apr 11, 2017, at 08:32 , Navneet Kumar <email@hidden <mailto:email@hidden>> wrote:
>>
>>> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, that determines whether it knows the background color and therefore whether it anti-aliases using the background color.
>>>
>> Tried anti-aliasing, explicitly turning it ON and OFF. No change.
>
> Well, I nearly had the right answer here. I tried a simple test project, using black text, and saw the effect you describe. Zooming into the display (Control+scroll) revealed the difference pretty clearly, since I could see the colors of the anti-aliased pixels. In the NSTextField text, LCD font smoothing is being used; in the drawn text, it is not. There is behind the scenes magic when drawing text, that determines whether it knows that LCD smoothing can be applied.
>
> When I turned the LCD smoothing option off in System Preferences -> General, the text rendered the same in both cases.
>
> Note that your choice of text color made the problem appear worse, because sub pixels were apparently being turned on both for smoothing and for coloring, which made the text look bolder than if it had been black.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden