title: Matplotlib fonts in Enthought Canopy
body: <p>I am using the matplotlib library inside Canopy, and the specific function is xkcd(). This function uses a specific font to plot charts. The font is Comic Sans MS, which if not present, should be downloaded.</p>
  
  <pre><code>/home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/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]))
  </code></pre>
  
  <p>I use the small script below, which checks the presence/absence of the font. If not present, it downloads it.</p>
  
  <pre><code>import os
  import urllib2
  if not os.path.exists('Humor-Sans.ttf'):
      fhandle = urllib2.urlopen('http://antiyawn.com/uploads/Humor-Sans-1.0.ttf')
      open('Humor-Sans.ttf', 'wb').write(fhandle.read())
  </code></pre>
  
  <p>The problem is that I still don't get the right font to display. In case there is a problem with the font cache, I do the following:</p>
  
  <pre><code>luis@luis-VirtualBox:~$ rm /home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/fontList.cache
  </code></pre>
  
  <p>Obtaining the following:</p>
  
  <pre><code>rm: cannot remove ‘/home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/fontList.cache’: No such file or directory 
  </code></pre>
  
  <p>What am I missing?</p>