Sorry, Gmail mangled the message. Repost, hopefully readable this time.
So I wrote the attached patch for fontconfig, that I will submit to
the fontconfig ML.
With the patch and freetype2, lcdfilter=lcddefault would correspond to:
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcdcustom</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfiltercustom">
<string>.0625 .25 .4375 .25 .0625</string>
</edit>
</match>
But it's not perfect, as users of the fontconfig API would have to
parse the lcdfiltercustom string themselves. I will ask if the
fontconfig developers see a better way of specifying a list of double.
Questions:
- Would there ever be a good reason to not have a symmetric FIR?
Should be the option be specified as ".4375 .25 .0625" (first half,
reverse order) and assume symmetry for the other weights?
- Could the size of the filter be different? Or is 5 likely to be
fairly universal, even for other renderers?
- When specified from the center value ".4375 .25 .0625", missing
values can be assumed to be 0, and extra values can be ignored. I'm
tempted to specify the option this way instead, unless asymmetric
filters are useful.
Thanks.