freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] anti-aliasing question


From: Tor Andersson
Subject: Re: [ft] anti-aliasing question
Date: Sun, 7 Feb 2010 15:11:59 +0100

Dave,

On Sun, Feb 7, 2010 at 2:39 PM, Dave Calkins <address@hidden> wrote:
> I changed the flags as you suggested, rebuilt, and tested it again.  I've
> attached a screenshot.  I'm not sure how much of a difference it made
> though.

That looks a lot more like it should. Compare the shape of the 5 and
the amount of gray to the left of the 0. This is what GDI used to look
like with the old pre-ClearType font smoothing, around the time
of Windows 98.

To match even closer, you'll need the ClearType colorization. As Werner
has explained, you'll need to render 3x as wide, apply a filter (triangle filter
is good) and store the resulting samples as an RGB texture. Then you need
to find a way to make OpenGL composite the text taking the alpha value for
each color channel separately from the texture.

As others have mentioned, you can also tweak the grayscale values
by applying a gamma function on the bitmap. I've found a gamma value
of 0.7 and 1.4 to be good for text rendering, depending on whether you're
rendering black on white or white on black.

lookup[i] = pow(i / 255.0, gamma) * 255.0;

-Tor




reply via email to

[Prev in Thread] Current Thread [Next in Thread]