Comment 60 for bug 164640

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Created an attachment (id=13825)
patch v2 for 1.5

This new versions adds LCD filtering to the public API as discussed on the mailing list. I also added support to read the filtering configuration from Fontconfig.

This patch is the merge of a series of smaller patches which are visible at http://spasche.net/hg/cairo-patches/file/. A description of each patch, in queue order:

lcd-filtering-david.diff
  This is the original patch that David wrote, slightly modified for 1.5 compatibility.

lcd-filtering-david-style-fix.diff
  This contains modifications for matching Cairo coding style more closely.

lcd-filtering-font-options.diff
  This contains the modification for adding the lcd filter option to the public API and the cairo_font_options_t type.

lcd-filtering-fc-compat.diff
  This adds define for compatibility when without the new lcd filtering constants (Fontconfig patch not yet applied, see bug 13566).

lcd-filtering-xlib-screen.diff
  Adds support to retrieve the lcd filter from the Xrm database (from the previous patch).

lcd-filtering-handle-fontconfig-fontoptions.diff
  The interaction with Fontconfig to deal with the lcd filter type.

lcd-filtering-doc.diff
  Update in the documentation files for the public API change

I hope this splitting can help you for the review, to understand the patch evolution. Maybe I could publish this as a private git repository, but I was familiar with mercurial queues already.

I'm using the legacy filter as a default when nothing is specified in Xrm or Fontconfig. This is the "less surprise" choice as the appearance won't change after being applied. Distributions can change the default in the global fontconfig configuration. I think this choice goes in the same direction as what was discussed on the mailing list.

The lcd-filtering-fc-compat.diff patch could be removed if we force the dependency on Fontconfig 2.6 (after the needed changes are in). But I guess this can be too much requirements.

The tests remain to be updated and added.

Of course the biggest part of this patch is the part from David. Unfortunately he seems not to have much time for Freetype/Cairo these days. I can try to help if you need some digging in that part.