Michael Droettboom <mdroe@...83...> writes:
The font lookup mechanism has been much improved in 0.91.2 -- you may
want to try using that. In 0.90.x, often if you don't get a perfectly
exact match for a font, it reverts back to the default "Vera Sans".
Vera Sans, however, is not a fixed-width font. Can you provide the png
file of fonts_demo.py so I can be sure of what is happening? One way to
diagnose this is to do
which will print out a bunch of stuff related to font lookup. Attach
the output here and I'll have a look at it to try to figure out what may
be going wrong.
Paul Smith wrote:
> Hi all,
> I've been trying in vain to get a better font on a plot than the fixed
> serif one that always appears. I've got lib-freetype6 installed (on Ubuntu
> server), and ran fc-cache after. The .matplotlib/ttfont.cache contains
> for the Free* fonts. The fonts themselves are
> in /usr/share/fonts/truetype/freefont. The sample code below would seem
> me) to have used FreeSans, but the png has the same bad looking fixed-
> When running the matplotlib examples/fonts_demo.py the result is the same
> all over that .png figure too (difference only in sizes).
> I usually work on XP, and it all works fine there. Does using only Agg as
> backend make any difference whatsoever?
> ubuntu 7.10
> python 2.5
> matplotlib 0.90.1
> Some sample code;
> import matplotlib
> from matplotlib import rc
> from pylab import *
> print 'font prop: ',l.get_font_properties()
> print 'font name: ',l.get_fontname()
> Produces this output;
> font prop:
(['Arial', 'FreeSans'], 'normal', 'normal', 'normal', 'normal', 12)
> font name: FreeSans
I put in the rc line you suggested below into fonts_demo.py but didn't see it
print any extra info (but did confirm in ipython that rcParams showed
verbose.level had changed to "annoying"). It just quietly finished otherwise.
Did I miss something here?
I've linked the output of fonts_demo.py to;
If I need to upgrade matplotlib above 0.90.1 I guess I'll have to build it
separately unfortunately. We're trying to stick to the standard ubuntu
packages that get pulled in for that release.
Thanks for your help,