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

libcairo2 in squeeze & subpixel rendering

Hi debian-devel,

As we all know, squeeze is frozen now. This was a long awaited event,
although for some importans software that we have in the distro it
would be beneficial if this moment could happen later. One of such
examples is libcairo2.

The last release by ustream [1] is 1.8.10. At the moment we have this
version in both testing and unstable. We also have 1.9.14 in
experimental, one of the very important features of which is a proper
support of fontconfig's attribute "lcdfilter" [2].

To those who are not familiar with this: this setting allows to tune
the final stage of subpixel rendering [3] that is a filtering stage,
the purpose of which is to reduce the visual color fringes around a
character. Unfortunately, there is no filter that could perform equaly
well with all available fonts. Fonts that have bytecode and are
full-hinted with the native hinter usually look better (i.e., give
less strain to the eyes) with the so-called "intrapixel" filters,
while the autohinted fonts with hintstyle = hintslight look better with
the so-called "interpixel" filters (or FIR lilters) [4, 5]. I am
writing this to make it clear that it is important to have this
filtering configurable.

The lcdfilter setting with possible values of lcdnone, lcddefault,
lcdlight (FIR filters), and lcdlegacy (itrapixel) has been supported
by fontconfig since version 2.6.0. Freetype has provided respective
filters since 2.3.0 (i.e., both were already available in lenny).
Qt-based applcations respected these settings since Qt 4.5 [6].

The current situation with GTK applications in squeeze is the
following. GTK aplications use cairo to render fonts. Cairo 1.8.10 has
its own intrapixel filter (which is equivalent to freetype's lcdlegacy
filter). It is impossible to redefine or tune this filter besides
setting subpixel order. This significantly reduces the set of fonts
that one can daily use with this filter without putting too much
strain on her eyes. Even worse: one is usually forced to use only
non-free fonts with this filter because the glyphs must be very well
hinted in order for this filter to be efficient.

For a long time there have been patches [7] that make cairo
lcdfilter-aware and let it use freetype's internal filters. Untill
recently (the commit [2] is dated June, 17th) the upstream was
reluctant to accept them, therefore many distributions applied these
patches on their own (so did Ubuntu; in the internet one may find many
guides of how to build and install these Ubuntu packages on Debian to
get "decent fonts"; we have also bugreports like [8]).

Thus, getting to the main point of this long e-mail: what are we going
to do with libcairo2 in squeeze? If we keep it at 1.8.10, I think it
makes sense to apply the above mentioned patch, because it has been
accepted by upstream and tested for quite a long time by other
distributions. Or are we going to wait for the next release of cairo
that might happen any time before squeeze releases, and then push it
into testig? This sounds less probable, knowing the usual Debian

[1] http://cairographics.org/releases/
[2] http://cgit.freedesktop.org/cairo/commit/?id=7a023a62f7517ad0d54f4d59c99909fadcc05e82
[3] http://en.wikipedia.org/wiki/Subpixel_rendering
[4] http://en.wikipedia.org/wiki/Intrapixel_and_Interpixel_processing
[5] http://freddie.witherden.org/pages/font-rasterisation/
[6] http://labs.trolltech.com/blogs/2008/09/01/subpixel-antialiasing-on-x11/
[7] http://bugs.freedesktop.org/show_bug.cgi?id=10301
[8] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555722


Reply to: