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

Behdad Esfahbod behdad at behdad.org
Thu Sep 25 12:41:07 PDT 2008

Carl Worth wrote:
> On Thu, 2008-09-25 at 14:58 -0400, Behdad Esfahbod wrote:
 >>   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.

Doh.  I'm sure I asked you the other time and you said you have subpixel all
over your desktop.  You have been running older cairo?

> 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:
> 	#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?

FreeType has the option to turn this feature on/off, just like it does for
patented bytecode interpretter.

> 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.

I thought I walked over this all in detail with you around the 1.6 release
time and we had reached a consensus that this is the right thing to do.

> 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.

Yes, the new code is no messier than the old one.

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

I just wish you have had followed what's going on and have raised your
concerns weeks earlier.  Not after multiple people spent hours if not days
carrying the work forward, not the day a major release is due out.

Whatever makes you get 1.8.0 out today, just go for it.


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

More information about the cairo mailing list