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

David Turner david at freetype.org
Thu Sep 25 18:27:14 PDT 2008


Carl,
the problem is veyr probably that you have a FreeType installation that
doesn't
support sub-pixel filtering, just like the default sources do.

for the record, here's how this works in FreeType currently:

- FreeType provides APIs that allow you to generate RGB decimated images
  as well as filter them with different algorithms. These APIs are available
on
  *all* builds of FreeType

- However, due to patents, the default build will ensure that all RGB
  images returned by the library obey the condition R=G=B, i.e. that the
  images are grayscale even when displayed through a "LCD" composite
  operation.

- You can manually change one configuration to change this in the build
  (FT_CONFIG_OPTION_SUBPIXEL_RENDERING in
include/freetype/config/ftoption.h)
  to override this limitation.

The idea is that clients of the library should assume that they can get the
proper RGB glyphs and compose them through their favorite RGB-enabled
graphics library. Even if they do that, their code will not be infringing
with a
default build of FreeType since technically it's still drawing grayscale
images.

I suggest that you rebuild FreeType on your system with the
FT_CONFIG_OPTION_SUBPIXEL_RENDERING option enabled and see if this changes
anything.

As for the state of the code, I'm sorry if it's not crystal clear; it's been
written a very long time ago :-)

Hope this helps

- David



2008/9/25 Carl Worth <cworth at cworth.org>

> So I stayed up all night trying to get the 1.8 release done.
>
> The test suite was in pretty bad shape as of the last 1.7.6 snapshot.
> There were dozens of failing tests, and the causes were all over the
> place:
>
> * Stale reference images needing to be updated
>
> * Known bugs that needed to be marked as XFAIL
>
> * New regressions that needed to be fixed
>
> It was pretty tedious work sorting through all that, and for the ones
> that were actual regressions we had to actually fix the bugs too. Thanks
> to Behdad, Chris, Emmanuel, and Adrian for helping out with that
> process.
>
> The final result I got to was a single test not passing, (I
> intentionally wasn't testing xlib to avoid X server/driver issues):
>
>        text-antialias-subixel
>
> And this one is a regression. It's giving me grayscale antialiasing
> instead of subpixel on image and other backends. The text passes fine
> back in 1.6.4.
>
> I bisected the failure down to this large commit:
>
>  commit 7f870035177da7aa63fa33dce837528f442d9ffe
>  Author: Sylvain Pasche <sylvain.pasche at gmail.com>
>  Date:   Tue Jan 22 23:51:32 2008 +0100
>
>    [cairo-ft] LCD filtering patch from David Turner
>
>    This is the patch David Turner wrote some times ago and can be found on
>    http://david.freetype.org/lcd/cairo-1.2.4-lcd-filter-1.patch. It was
>    somewhat modified for compatibility with cairo 1.5
>
> I spent a fair amount of time trying to debug this, but never succeeded.
> So now I'd like some suggestions on how to proceed. One option is to
> revert the patch, (it broke an existing test in the test suite after
> all). I've got a patch in my personal repository, (revert-lcd-filter
> branch), that does this and which seems to work:
>
>    http://cgit.freedesktop.org/~cworth/cairo/log/?h=revert-lcd-filter
>
> But meanwhile, I know that some users were particularly keen on being
> able to control, (via fontconfig), the various LCD filter options made
> available by freetype. And reverting this patch would remove that
> possibility.
>
> Behdad, do you have some guidance here? Can you fix the code so that the
> test suite works? Or shall we just go ahead with the revert and bring
> back the LCD filter functionality in 1.8.2 or so? I know you were hoping
> to wake up and see that the release had already happened. Sorry that
> didn't happen, but this is really the last issue left.
>
> -Carl (overdue for sleep)
>
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080926/f45d36df/attachment.html 


More information about the cairo mailing list