Aliased text renders to the left of the drawing origin
Aliased text renders to the left of the drawing origin
- Subject: Aliased text renders to the left of the drawing origin
- From: Jonah Petri <email@hidden>
- Date: Thu, 6 May 2010 16:41:44 -0400
Hello,
I'm seeing a problem with rendering of certain fonts, when rendering them in a graphics context where antialiasing has been disabled. In particular, ArialMT 11 pt seems to render its double-u's one pixel to the left of the origin point. Also, a double-u at the end of the string seems to overflow the bounding box which the text measurement returned.
I'm measuring the text with:
[[NSGraphicsContext currentContext] setShouldAntialias:NO];
NSRect boundingRect= [text boundingRectWithSize:bigSize options:NSStringDrawingUsesDeviceMetrics attributes:m_pDrawingAttributes];
and drawing it like so:
[[NSGraphicsContext currentContext] setShouldAntialias:NO];
[text drawWithRect:drawRect options:NSStringDrawingUsesDeviceMetrics attributes:m_pDrawingAttributes];
I've filed this as rdar://7952168, but I'm interested in workarounds or others' experiences.
Note that from my experiments, this doesn't seem to happen in antialiased situations.
Thanks!
-Jonah
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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