[cairo] Struggling with subpixel text (last blocker for 1.8)

Carl Worth cworth at cworth.org
Thu Sep 25 12:26:21 PDT 2008


On Thu, 2008-09-25 at 14:58 -0400, Behdad Esfahbod wrote:
> I suspect your fontconfig configuration.  I've seen you have this problem
> before :).

Actually, I think that might not be the problem.

>   I just compiled FreeType with subpixel enabled and confirmed that
> I get subpixel rendering form that test (were not getting before). 

And I think that you just gave me the key.

I apparently don't have freetype with subpixel enabled, (but the
flag-based interface along with our custom #defines hide that). I tested
that by adding a #error here:

	#ifndef FT_LCD_FILTER_NONE
	#error No freetype lcd-filter support

Our header file suggests "2.3.5(?)" as the required version, but I've
got 2.3.7 (from a Debian package) installed here. Is the code not
reliably compiled into freetype?

So this brings up a new problem. The current code introduces a
regression, (working subpixel text becomes non-working subpixel text
with no change in the system configuration---no change to freetype).

That makes the current code a non-starter.

The point of this was to add functionality, (allow the user to select
various lcd-filter options), but not to take working functionality away.
I think we need to just revert the patch, or else add the original code
alongside and have cairo choose which one is available.

> It's slightly different from the ref image, but looks as correct.

I haven't looked yet to see if this is really objectionable, but I don't
like the sounds of this. I had been under the impression that LEGACY was
the same filter cairo had been using before. Comparing the old and new
reference images the new coolers do look a bit more garish, (but it's
hard to judge based on them since they are intentionally unhinted so not
really good for evaluating).

Meanwhile, while debugging I found other reasons not to like the code in
cairo right now. We've got an #if 1; #else; #endif block sitting there
for no reason, (can't seem to decide where the alpha channel should come
from in some cases), a bare /* XXX */ comment which is just disturbing,
and some generally inscrutable logic in _cairo_ft_font_options_merge.

Admittedly, some of those problems may have been present before the
lcd-filter patch---I didn't look closely.

But I am a grumpy maintainer[*] right now.

-Carl

[*] And we can probably blame at least some of that on lack of sleep...




More information about the cairo mailing list