Re: Sub-pixel font smoothing with CGBitmapContext
Re: Sub-pixel font smoothing with CGBitmapContext
- Subject: Re: Sub-pixel font smoothing with CGBitmapContext
- From: Slava Pestov <email@hidden>
- Date: Thu, 29 Jan 2009 20:03:48 -0600
On Thu, Jan 29, 2009 at 12:56 PM, David Duncan <email@hidden> wrote:
> Its been a while since I last looked at this, but I think the context's
> format needs to be native endian (add the kCGBitmapByteOrder32Host flag).
Thanks for the tip! I also noticed that I have to use
kCGImageAlphaPremultipliedFirst instead of
kCGImageAlphaPremultipliedLast.
So, just to summarize for the other people following this discussion,
it seem there are two things that have to be in place for sub-pixel
font smoothing to work in a CGBitmapContext:
- You need to create the context with (kCGImageAlphaPremultipliedFirst
| kCGBitmapByteOrder32Host).
- Also you must fill the context with a non-transparent background so
that the sub-pixel blending can take place.
Also, I discovered the GL_BGRA_ext extension can be used to turn such
a bitmap into an OpenGL texture.
Slava
_______________________________________________
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