[cairo] Sub-pixel Font Filtering in 1.10

Freddie Witherden freddie at witherden.org
Fri Jan 15 15:22:07 PST 2010


On Friday 15 January 2010 22:55:50 Carl Worth wrote:
> On Fri, 15 Jan 2010 14:20:19 -0800, Keith Packard <keithp at keithp.com> wrote:
> > What you don't want to do is mix two different rasterization techniques
> > on the screen at the same time. That's like mixing anti-aliased and
> > non-antialiased text; the eye is distracted by the jarring differences,
> > making reading much more difficult.
> 
> This is an important point.

Absolutely. Consistency is paramount and am glad that there appears to be a 
consensus on this!

An interesting anecdote regarding consistency happened to me some weeks back. 
I was viewing a page in Firefox and noticed that small monospaced text (DejaVu 
Mono) appeared somehow different to that of everything else. After quite a lot 
of digging I found that when I had applied the Ubuntu patches to my Debian 
copy of Fontconfig I had brought along a rule which enabled the legacy (intra-
pixel, hope I've got it right this time) filter for small point size 
DejaVu/Bitstream Mono. Now, the text did not look bad; just different. This 
difference was distracting -- enough to divert my attention for 20 minutes or 
so to track it down.

> Opinions of software developers and theoretical correctness mean
> absolutely nothing when a minority of the text on the display is
> rendered differently than everything around it. The difference is quite
> noticeable and the rendering in the minority will almost always appear
> "wrong".

Indeed and it appears as if things are only getting worse. We've got OpenType 
fonts coming from all directions -- many with PS outlines and no hinting -- 
SVG fonts -- again with no hinting instructions -- PDF/PS documents where 
certain kinds of hinting are unsuitable and finally WOFF (web fonts, FF 3.6) 
and who knows what they will have.

If there exists a consensus on consistency then it is only a small step to 
conclude that only methods which are universally suitable in all 
situations/scenarios can obtain consistency. This is why I argue in favour of 
auto-hinting and FIR-type filters: they *always* work. (And I suspect this is 
why Apple and Microsoft are moving/have moved in this direction.)

> And that's perhaps another good point to justify cairo respecting any
> system configuration (such as in fontconfig). It also (again) argues and
> API in cairo to tweak things, as that would simply allow an application
> to look "different" than everything around it.

I am mostly okay with tweaks so long as they have a physical significance. 
Disabling hinting, for example, allows for freely scalable text, disabling 
sub-pixel rendering allows for a surface to be printed/used on the web. As an 
aside it is worth noting that Qt provides virtually no control whatsoever over 
hinting &c, you just get what Fontconfig specifies, --- a decision which has 
caused its own share of problems.

Polemically yours, Freddie.


More information about the cairo mailing list