<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Wrong legacy sub-pixel filter number leading to bad filtering"
href="https://bugs.freedesktop.org/show_bug.cgi?id=92981">92981</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong legacy sub-pixel filter number leading to bad filtering
</td>
</tr>
<tr>
<th>Product</th>
<td>fontconfig
</td>
</tr>
<tr>
<th>Version</th>
<td>2.11
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>library
</td>
</tr>
<tr>
<th>Assignee</th>
<td>fontconfig-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>benoar@dolka.fr
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>freedesktop@behdad.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=119747" name="attach_119747" title="[PATCH] Fix wrong legacy LCD sub-pixel filter number">attachment 119747</a> <a href="attachment.cgi?id=119747&action=edit" title="[PATCH] Fix wrong legacy LCD sub-pixel filter number">[details]</a></span>
[PATCH] Fix wrong legacy LCD sub-pixel filter number
I was having bad font filtering for some years on urxvt: I am used to the
“legacy” LCD filter, and it didn't work anymore very well starting with Debian
wheezy. I finally traced it back to fontconfig: a change to urxvt (in wheezy)
made it aware of the lcd filter used, through FT_Library_SetLcdFilter() which
got its setting from FcPatternGetInteger(…, FC_LCD_FILTER, …). Before that
change to urxvt, strangely, the filtering worked well, I think because the
system default that I set was set more “right” (i.e. not through fontconfig
API, but somehow internally, I suppose) by fontconfig.
So, the bug I found is that FC_LCD_LEGACY (FC_LC_FILTER setting for the legacy
filter) is set to 3 in fontconfig, while it is 16 in FreeType; see
<<a href="http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html">http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html</a>> or
<<a href="http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/freetype/ftlcdfil.h#n137">http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/freetype/ftlcdfil.h#n137</a>>.
The result is that FreeType then uses no LCD filtering as it does not know this
filter number, leading to colorful fonts. This dates back to 2008…
The attached patch fixes it and makes me happy. BTW, I do not understand why
you do not get this information directly from FreeType's headers, instead
copying it… could it solve further problems if you did it so? Is this in a TODO
list needing some patch?
And finally, I saw that the legacy filter seems “deprecated” and may go away
one day; I know I should rather tell the FreeType developers, but I would like
to pray you for it here: please keep it around! I use strong hinting with this
filter, and it works beautifully!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>