[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] optimal configuration to render fonts using gamma correction
From: |
Francesco Abbate |
Subject: |
[ft-devel] optimal configuration to render fonts using gamma correction |
Date: |
Tue, 31 Jul 2012 19:51:48 +0200 |
Hi all,
I'm adding freetype support to my project, gsl shell, and I have one
question for the experts that can be in this ML.
I've added support to render text using the freetype library using the
AGG library of Maxim Shemarev. To render the font I obtain the outline
given by freetype and I render the image using AGG rendering
capabilities. The rendering pipeline is quite sophisticated because I
use anti aliasing rendering with gamma correction done at pixel
blending level (this is the standard AGG approach).
In addition I perform subpixel rendering as described here:
http://www.antigrain.com/research/font_rasterization/
and in Gibson's page: http://www.grc.com/cleartype.htm
I've actually used the Maxim's implementation as a starting point that
I did improve and generalize it so that I can easily render any
graphics with subpixel precision. I'm quite sure that my
implementation is correct and it does closely reproduce the Gibson and
Maxim's results.
In Maxim's implementation the hinting is done only vertically by using
a trick to scale by a factor 100 along x direction before hinting and
doing the inverse transformation before rendering. The subpixel
rendering code is just a plain implementation of the technique
described by Gibson the only variable parameters being the weights of
channels in the color filter.
I believe that gamma correction is necessary to render properly
antialiased graphics but when I render the text with gamma correction
it looks too much light, almost washed out.
I've included here some images to show the problem I'm talking about:
no gamma - gray: http://imagebin.org/222765
gamma 2.2 - gray: http://imagebin.org/222766
no gamma - subpixel: http://imagebin.org/222767
gamma 2.2 - subpixel: http://imagebin.org/222768
So, here came my question, is the washing out of text with gamma
correction a known problem ? What are the best known methods to render
texts ? They use gamma correction or not ? Are any other techniques
used to improve the rendering ?
My reference in term of font rendering is Ubuntu that does a superb
job with fonts but it is difficult for me to guess the details of
their font rendering methods.
I hope you can give me some help with the problem. Thank you in
advance in any case.
Best regards,
Francesco
- [ft-devel] optimal configuration to render fonts using gamma correction,
Francesco Abbate <=