freetype
[Top][All Lists]
Advanced

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

Re: [ft] changing the depth of gray for anti-aliasing


From: Collyer, Oliver, SI
Subject: Re: [ft] changing the depth of gray for anti-aliasing
Date: Mon, 13 Feb 2012 12:15:44 +0000

Just something I can add to this.

I spent a bit of last year improving the font rendering in our product and 
after much reading up I found that the AGG approach mentioned below by Peter 
turned out to be a good one for small fonts, that is to hint only vertically, 
but use subpixel blending to make things look optimal horizontally . The reason 
I found this a good compromise was that it preserves both sufficient sharpness 
at low point sizes while not unduly distorting the glyphs such that the font 
becomes too far away from how the designer intended it to look.

However, I was running side-by-side comparisons with Apple's OS X font 
rendering and noticed something that was bothering me - namely that small light 
text on a dark background looked much stronger under the Apple rendering than 
it did with FreeType. Under FreeType with subpixel blending with the default 
filter I found that the text looked much weaker, and generally not as nice. On 
the other hand, the same dark text on a light background, however, looked 
pretty much identical, which suggested that something was being done by the OS 
X renderer in the former case to 'strengthen' the text.

I posted about this on the list, and experimenting with gamma was the 
suggestion (from Werner, I think). This didn't really solve it for me - I still 
couldn't quite get things to look as I wanted.

What did solve it was a simple algorithm that used the contrast between the 
text colour and the background colour to distort the alpha values produced by 
FreeType. I found a good solution, which gave comparable results to the OS X 
rendering, was to make it so that at maximum contrast (so white text on a black 
background) it basically mapped the alpha values to the top left quadrant of a 
curve - so at low alpha values, the mapped value would rise steeply, whereas 
high alpha values would drop more slowly (thus appear thicker). At lesser 
contrasts, it would 'straighten' out thus curve until at zero contrast or below 
(i.e. dark on light) it would leave the alpha values unchanged.

I guess this sort of distortion is kind of similar to what a gamma value does, 
but I found that what I was doing produced a closer resemblance to the OS 
X-style rendering I was after.

Maybe that helps, probably it doesn't, but I thought I'd share it anyway in 
case it does.

On 13 Feb 2012, at 11:22, David Bevan wrote:

> 
> Peter,
> 
> Perhaps I'm misunderstanding something, but surely the problem is that the 
> algorithm used to blend the anti-aliased text with the background doesn't 
> properly take into account the relevant properties of the human visual system.
> 
> It should be possible to develop a suitable blending algorithm that has a 
> (more) perceptually uniform effect. I've no idea whether anyone's done so 
> though.
> 
> David %^>
> 
> 
> -----Original Message-----
> From: address@hidden [mailto:address@hidden On Behalf Of Peter Grandi
> Sent: 11 February 2012 20:05
> To: Freetype users
> Subject: [ft] changing the depth of gray for anti-aliasing
> 
> I have been for a long time rather unhappy with anti-aliasing
> because of it makes text bolder and fuzzier than it should be,
> at least on monitors with 100DPI or so, but I have recently
> realized, as described here:
> 
>  http://www.sabi.co.uk/blog/12-two.html#120206
> 
> and in particular by this side-by-side comparison image:
> 
>  http://www.sabi.co.uk/Misc/snapFontAliasingDarkLight.png
> 
> that anti-aliased text looks very different on dark backgrounds
> (thinner, not so fuzzy) than on light ones (thicker, fuzzier).
> This is all without subpixel anti-aliasing (gray-level only).
> 
> My guess is that this happens because at around 100DPI most 10
> point fonts render with 1-pixel wide features, and ''graying''
> around that makes it look thicker, but how dark the gray is
> matters a lot: if it is lighter, on light backgrounds the
> apparent extra thickness will be less apparent, and viceversa on
> dark backgrounds.
> 
> Therefore it would be nice to be able to control how dark is the
> anti-aliased "fuzz", so it can be rather lighter than the default
> on light backgrounds and a little darker on dark backgrounds.
> 
> Is there a runtime tweakable already?
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype




reply via email to

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