One thing to keep in mind is that behind the scences, the Freetype FIR
filter is implemented as an array of 5 FT_Bytes, which means the values
are only 0 through 255 for each FIR component. So, the floats could
ultimately be getting rounded somewhat, belying their precision. But, I
think we'd also want to avoid requiring people to use hex notation or
values 0 through 255 ;) So, float might be best.
Freetype actually uses a 5 byte array even for the FIR filter (light
LCD) which really only has 3 meaningful values. So, as far as Freetype
goes, I think 5 makes perfect sense. I can't speak for anything else
though.
I have heard of people using an asymmetrical FIR filter, but it's
probably so rarely used that it would justify not implementing if it
were considerably more difficult to do. I think that just specifying 5
values is the easiest and least-confusing thing to do. If someone is in
there tinkering with these settings, they are probably smart enough to
understand decimal notation. ;)
My thoughts,
Erik
On 11/20/2011 04:50 PM, Eric Rannaud wrote:
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.
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel