[cairo] Sub-pixel Font Filtering in 1.10

Freddie Witherden freddie at witherden.org
Fri Jan 15 12:56:26 PST 2010


On Friday 15 January 2010 20:07:59 Carl Worth wrote:
> As display devices improve, those pixel boundaries will become less
> meaningful, and then I'll agree with you that the filtering should
> ignore them.

Interesting. All of the information I have seen (including viewing my own 
screens under a microscope) showed there to be no perceptible gap between the 
sub-pixels of adjacent pixels.

Wikipedia also includes some neat captures which paint a similar picture:
http://en.wikipedia.org/wiki/File:Subpixel_photo_w.jpg
http://en.wikipedia.org/wiki/File:Pixel_geometry_01_Pengo.jpg

Hence I believe that an extremely strong case can be made for ignoring such 
boundaries in the default case *today*.

> I've always thought "hinting" was a bad name for this. What we should be
> talking about is "instructed" fonts since the fonts themselves contain
> instructions (from the font designer) on how the shape should be
> constructed at various glyph sizes. Even modern fonts, created after "a
> time when anti-aliasing was practical" seem to be shipping with these
> instructions still. (And it's a fairly expensive job for a font designer
> to create them). So it's not obvious to me that this is going away, (nor
> does it seem fair to describe the process of implementing
> font-designer-supplied instructions as "distortion").

A couple of points here. Firstly, very few professional fonts (such as those 
in Adobe's Font Folio collection of OpenType fonts) contain TypeType bytecode 
hinting. In fact, nearly all OpenType fonts contain Type1 outlines (which have 
limited support for hinting, certainly nothing close to pixel-perfect bytecode 
hinting).

(Empirical evidence for this is available. First, we note that OpenOffice (< 
3.2) under Linux lacks support for Type1 fonts in an OpenType container. Next 
we consider qa: Issue 16032 and qa: Issue 78858 --- two of the most voted for 
issues --- are regarding the lack of support for PS outlines in OpenType 
fonts.)

At this point our candidate set is reduced to .ttf fonts and OpenType fonts 
with .ttf outlines. It is true that many do contain bytecode hinting 
instructions. However, they are nearly always generated mechanically rather 
than being 'hand tuned.' Ironically the FreeType auto-hinter often does a 
better job here than the actual bytecode.

Very few font designers are up to the process of font instructing; a fact 
Microsoft themselves acknowledge: 
http://www.microsoft.com/typography/tools/vtt.aspx (Microsoft Visual TrueType, 
an instructing application.)

Now, this is not the fault of the font designers (who are often not 
programmers). Font design is a creative process --- one which is complete when 
you have a working font that looks good on paper. Rasterisation on low DPI 
systems is a technical, as opposed to creative, issue and one with several 
non-invasive solutions.

> The other point I would disagree with is the attempt to dismiss
> intra-pixel filtering as objectively "technically inferior". I'll agree
> with you that this filtering only makes sense with well-hinted text. But
> I would go beyond that to say that sub-pixel rendering only makes sense
> with well-hinted text. (Since otherwise, the color fringing is *always*
> objectionable given sufficiently capable display hardware).

Under the assumption that there is no gap between sub-pixels (which until 
today I had assumed to be the case) it is simple to show objectively using 
Fourier theory. Of course, if there is a gap then a technical argument can be 
made.

Of course, I do not expect any of these points to change your stance. The 
facts are the facts: on your set-up one configuration looks better than the 
other and hence it would be foolish of me to attempt to dismiss it with any 
number of points. So please do not interpret this message as myself attempting 
to change your stance --- but instead to better explain where my views and 
opinions on the subject stem from :)

Polemically yours, Freddie.


More information about the cairo mailing list