Quantcast

getting matplotlib to recognize a new font

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getting matplotlib to recognize a new font

cabraut
Hi, All,

I am using matplotlib 1.2.0 under Windows 7 64-bit.

I am trying to get matplotlib to recognize a new font that I downloaded (Arimo, for the curious).  I put the .ttf files in the matplotlib ttf font directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream Vera Sans, STIX, etc. live.  But matplotlib does not recognize the new font, and defaults to Vera Sans.  If I load the font_manager and do a findfont, it does not find the new font and defualts to Vera Sans.

I also tried putting the ttf files in the system font location, with the same results.  When I do this, other programs like Word can see and use the font.

Is there some trick that I'm missing, here?

Thanks,
Chad

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting matplotlib to recognize a new font

Benjamin Root-2


On Thu, Feb 28, 2013 at 8:40 AM, CAB <[hidden email]> wrote:
Hi, All,

I am using matplotlib 1.2.0 under Windows 7 64-bit.

I am trying to get matplotlib to recognize a new font that I downloaded (Arimo, for the curious).  I put the .ttf files in the matplotlib ttf font directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream Vera Sans, STIX, etc. live.  But matplotlib does not recognize the new font, and defaults to Vera Sans.  If I load the font_manager and do a findfont, it does not find the new font and defualts to Vera Sans.

I also tried putting the ttf files in the system font location, with the same results.  When I do this, other programs like Word can see and use the font.

Is there some trick that I'm missing, here?

Thanks,
Chad


Most likely, you need to clear out matplotlib's font cache.  How to do that for windows, I don't know, but for Linux, it is as simple as "rm ~/.matplotlib/fontList.cache".  Maybe there is a similar file somewhere on your system.  After getting rid of that file, at the next import of matplotlib, it will recognize that that file is gone and rebuild it.

Cheers!
Ben


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting matplotlib to recognize a new font

cabraut
That did it, Ben!

Many thanks,
Chad




From: Benjamin Root <[hidden email]>
To: CAB <[hidden email]>
Cc: Matplotlib Users <[hidden email]>
Sent: Thursday, February 28, 2013 8:19 AM
Subject: Re: [Matplotlib-users] getting matplotlib to recognize a new font



On Thu, Feb 28, 2013 at 8:40 AM, CAB <[hidden email]> wrote:
Hi, All,

I am using matplotlib 1.2.0 under Windows 7 64-bit.

I am trying to get matplotlib to recognize a new font that I downloaded (Arimo, for the curious).  I put the .ttf files in the matplotlib ttf font directory (...\\fonts\\ttf\\ArimoRegularLatin.ttf, etc.), where Bitstream Vera Sans, STIX, etc. live.  But matplotlib does not recognize the new font, and defaults to Vera Sans.  If I load the font_manager and do a findfont, it does not find the new font and defualts to Vera Sans.

I also tried putting the ttf files in the system font location, with the same results.  When I do this, other programs like Word can see and use the font.

Is there some trick that I'm missing, here?

Thanks,
Chad


Most likely, you need to clear out matplotlib's font cache.  How to do that for windows, I don't know, but for Linux, it is as simple as "rm ~/.matplotlib/fontList.cache".  Maybe there is a similar file somewhere on your system.  After getting rid of that file, at the next import of matplotlib, it will recognize that that file is gone and rebuild it.

Cheers!
Ben




------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Loading...