Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managing fonts #40

Open
cmundi opened this issue Feb 24, 2014 · 3 comments
Open

Managing fonts #40

cmundi opened this issue Feb 24, 2014 · 3 comments

Comments

@cmundi
Copy link

cmundi commented Feb 24, 2014

Example: When I create an xkcd-style plot using PyPlot.jl (see https://gist.github.com/cmundi/9041366) in a fresh session of IJulia, I get this error:

/usr/local/lib/python2.7/dist-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['Humor Sans', 'Comic Sans MS'] not found. Falling back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext]))

Ok, so matplotlib apparently cannot find the Comic Sans font. That makes sense, because I don't see that font in /usr/share/fonts/truetype. But hold on a second! If I run the usual examples of xkcd in IPython (not IJulia) the comic sans fonts render in the plots -- no problem! Just for fun I installed the MS fonts which include Comic_Sans_MS.ttf and rebuilt the cache with

fc-cache -rv

which picked up the new fonts. Started a new session of IJulia and... no comic sans for xkcd... still gives me the fallback sans serif fonts.

I would say this is a font config problem (with IPython finding Comic Sans and IJulia not finding it) but that seems strange since PyPlot.jl is a wrapper around matplotlib. Any ideas?

Yes, I know, I should be making a useful contribution to society instead of worrying about xkcd. :)

Thanks.

@stevengj
Copy link
Member

Hmm, I have no idea how matplotlib finds fonts. Maybe there is some path that gets set when you run python which is not getting set by linking to libpython?

@stevengj
Copy link
Member

Does it work if you run pygui(true) so that plots pop up in a separate window? (I'm wondering if this is specific to the Agg backend.)

@cmundi
Copy link
Author

cmundi commented Feb 25, 2014

Good suggestions. I am traveling and not ignoring. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants