Re: NSTextView, NSImage and Anti-Aliasing
Re: NSTextView, NSImage and Anti-Aliasing
- Subject: Re: NSTextView, NSImage and Anti-Aliasing
- From: Aki Inoue <email@hidden>
- Date: Fri, 18 Nov 2005 12:07:43 -0800
I believe what you're observing is subpixel rendering mismatch that
existed on Panther.
By default, AppKit's text system render tries to use subpixel
rendering on LCD monitors.
This causes problems rendering into off-screen buffer since it cannot
represent subpixel values.
You can explicitly disable the font smoothing effects when rendering
to off-screen images with CGContextSetShouldSmoothFonts
([[NSGraphicsContext currentContext] graphicsPort], false).
On Tiger, CG automatically detects the situation and disable it.
Aki
I'm trying to write text into an image but it looks like the text
isn't being anti-aliased. I'm not sure if I'm just seeing things or
what but I can't seem to get it to be rendered correctly. My code
looks like this:
result = [[NSImage alloc] initWithSize:size];
[result lockFocus];
[NSGraphicsContext saveGraphicsState];
[[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationHigh];
[[NSGraphicsContext currentContext] setShouldAntialias:YES];
[string drawAtPoint:NSMakePoint(0, 0) withAttributes:attrs];
[NSGraphicsContext restoreGraphicsState];
[result unlockFocus];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden