freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] ClearType-like results


From: Vadim Plessky
Subject: Re: [Devel] ClearType-like results
Date: Sat, 17 May 2003 21:32:22 +0400
User-agent: KMail/1.5

On Friday 16 May 2003 15:08, David Turner wrote:
|  Yaroslav Rastrigin wrote:
|  >
|  > My question is simple - what should I do to achieve ClearType-like
|  > results in subpixel-antialiased text rendering ? Is there any way do do
|  > aforementioned rendering "MS style ?".
|
|  There are several ways to achieve LCD-optimized rendering. I'm not even
| certain that the ClearType in Windows XP is the same than the one found in
| the original "Microsoft Reader" program that I downloaded some time ago.
| Adobe Acrobat 5 also implements it differently than Windows, so do libXft
| (which does manage sub-pixel decimation !) or FreeType itself.

I am confident that ClearType in Windows XP is much better than ClearType in 
Microsoft Reader.

[...]
|
|  there is nothing in ftgrays about sub-pixel decimation, since it only
| deals with converting outline into gray-level bitmaps at the pixel or
| sub-pixel level.
|
|  Now, here's a small "generic" description of how to produce sub-pixel
| optimized text:
|
|     1 - adjust outline hinting for the sub-pixel space.
|
|     2 - dilate the resulting outline by a factor or 3 in either the
| horizontal or vertical direction.
|
|     3 - render the resulting outline into an 8-bit pixmap. However, the
| pixel buffer should be read as a RGB buffer (in the horizontal direction)
|
|     4 - *filter* the resulting RGB pixmap to reduce color bleeding
|
|     5 - "blend" the resulting glyph to the target pixmap. This requires
|         a special blitting operation where each R,G,B channel has its own
| alpha value taken from the filtered pixmap. This may also require gamma
| correction !!
|
|  FreeType 2 allows you to perform steps 1, 2 and 3 rather easily. The
| filtering and blending parts are not. Because the glyphs are not filtered,
| you'll experience unpleasant color frings in the output of "ftview". For
| now, this is normal, though we may want to add filtering to the "ftview"
| program, or add a new API like FT_Set_RGB_Filter(..) to make it part of the
| engine some day.

This is certanly good idea!
Plugin-like filter for FreeType is a very nice to have feature.
I believe very good results can be achieved with Median filtration, combined 
with High and Low frequency clean-up (before Median filter)
Those are certanly expensive operations, but can be optionally implemented in 
MMX/SSE.
But most important that  this can dramatically improve quality!

|
|  For you record, libXft implements 1+2 with the following scheme:
|
[...]
|
|  In all cases, there is no point of producing sub-pixel optimized glyphs if
| you don't have the necessary filtering and blending routines as well
| (fortunately for Linux users, these are provided by libXft and the RENDER
| extension respectively).

I am wolndering here wether similiar plugin-like filters can be implemented at 
libXft level.
Than GNOME and KDE can UI frontends to those settings, allowing enhanced 
control over resulting rendering in GUI-based environments.
So far, libXFt has "closed" architecture without too much control over 
rendering process.

|
|  Hope this helps,
|
|  - David Turner
|  - The FreeType Project  (www.freetype.org)
|  _______________________________________________
|  Devel mailing list
|  address@hidden
|  http://www.freetype.org/mailman/listinfo/devel

-- 

Best Regards,

Vadim Plessky
SVG Icons * BlueSphere Icons 0.3.0 released
http://svgicons.sourceforge.net




reply via email to

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