[cairo] Subpixel Positioning w/FreeType

Bill Spitzak spitzak at gmail.com
Wed Oct 7 17:13:28 PDT 2009


May want to investigate how many subpixel positions are needed so that a 
diagonal line of text looks straight. I think this may have stronger 
requirements than a horizontal line of text. Try using Cairo to draw 
small tilted anti-aliased rectangles and see what rounding factor for 
the position you can get away with before a row of them does not look 
straight.

Also the number of positions needed probably goes down as the font size 
gets bigger.

The 4 bits may only be some internal data storage and ClearType may be 
using fewer images, ie some of the 16 possible sub-positions map to the 
same glyph. 4 is the smallest power of 2 that will give 3 positions 
anything close to equal weight and may explain why it was chosen.

James Cloos wrote:
>>>>>> "Rob" == Rob Arnold <tellrob at gmail.com> writes:
> 
> Rob> I'm pretty sure it's new in WPF/DirectWrite. But I'm not sure it
> Rob> uses 1/3 for sub pixel positioning. Before picking a fraction, it
> Rob> would be good to find out what the other rasterizers have chosen
> Rob> for their pixel subdivision.
> 
> The note about Cleartype recently posted, IIRC, to the opentype list
> says that it uses 4 bits of fraction.
> 
> -JimC


More information about the cairo mailing list