Subpixel rendering is almost never what you want when producing a PNG 
file, since it is likely to be shared on a different machine requiring 
different subpixel settings.  But it looks like your mozilla example is 
not using subpixel rendering either, though it appears to have very 
strong hinting.

matplotlib's Agg backends borrows a technique used by Adobe Acrobat 
which is to use strong hinting in the vertical direction, but more 
subtle hinting in the horizontal.  When we did a comprehensive 
comparison of various hinting options about two years ago it was the 
strong winner.  See this:

   
http://www.mail-archive.com/matplotlib-de...@lists.sourceforge.net/msg01480.html

(Unfortunately, the linked images are no longer available).

If these settings are not to your liking, I would recommend the Cairo 
backend (which should pull in the same settings as the rest of your 
Gnome desktop, I believe), or one of the vector backends and then 
tweaking the rendering.

Alternatively, we could provide this "stretched hinting" as a 
configuration option.  If you think that's superior to these other 
options, please file a feature request so it doesn't get lost (and it 
should be a fairly straightforward patch for someone new to the code base.)

Mike

Darren Dale wrote:
> On Tue, Dec 1, 2009 at 6:37 AM, Ernest Adrogué <eadro...@gmx.net> wrote:
>   
>> 30/11/09 @ 22:28 (-0600), thus spake John Hunter:
>>     
>>> The two examples in the page you link to have different font sizes and
>>> possibly different font weights, which makes it difficult to do
>>> side-by-side comparisons.  Could you post an example with
>>> similar/identical settings?
>>>       
>> Yes, I have attached another example with different font sizes
>> (8,9,10). The exact weight is impossible to replicate, I tried with
>> "light" and "normal".
>>
>> I think that the problem might be the lack of hinting. In my
>> fonts.conf file I have both "hinting" and "autohinting" enabled. if
>> I disable these options then the fonts in other applications resemble
>> a lot the ones I am getting now with mpl.
>>     
>
> I am pretty sure the issue here is subpixel rendering. Try comparing
> the output of the gtkagg backend, which does not do subpixel
> rendering, with that of gtkcairo, which does.
>
> Darren
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to