[cairo] xlib backend mis-draws fonts with partial bitmap strike

Sylvain Pasche sylvain.pasche at gmail.com
Tue Dec 11 16:13:25 PST 2007


Behdad Esfahbod wrote:
> On Tue, 2007-10-30 at 10:46 -0700, Keith Packard wrote:
>> On Tue, 2007-10-30 at 12:54 -0400, Behdad Esfahbod wrote:
>>
>>> Heh, so this finally came up.  I'm fine with the second option.  It's
>>> the right fix and not as hard as it sounds first.  We don't need to use
>>> different glyph spaces even.  And the per-glyph glyphset can be stored
>>> in scaled_glyph->surface_private that we don't really use currently.
>> I'm actually thinking the pure-A1 option is better at this point --
>> othewise you'd mix AA and non-AA text in the same line, which can be
>> disturbing.
> 
> I thought about that too.  At some point someone's going to nag about it
> if we do either way.  Anyway, was hacking up second option, put it down
> now.

Hi,

So here comes the nagging ;-)

The first option is not playing well for some fonts like Courier New 
(from Microsoft TrueType core fonts).

This font has very partial bitmap strikes: only 3 glyphs have bitmaps 
for font sizes between 4 and 21.

Solution 1 above makes all glyphs for sizes below 21 be drawn without 
antialiasing. These glyphs looks not very nice for sizes under 12/13 
(see screenshot, I'm using autohinter. Results are better with the 
bytecode interpreter).

So solution 2 would be better for this font, while 1 is better for Sazanami.
What about implementing solution 2, and let users who do not want to mix 
AA and non-AA set "antialias = false" via fontconfig on their fonts for 
sizes where bitmaps are available?


Regards,
Sylvain

-------------- next part --------------
A non-text attachment was scrubbed...
Name: font-test.png
Type: image/png
Size: 10772 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071212/230663a6/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: font-test.c
Type: text/x-csrc
Size: 2036 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071212/230663a6/attachment.c 


More information about the cairo mailing list