[Matplotlib-users] truetype font is missing table

Neal Becker ndbecker2 at gmail.com
Thu Dec 17 07:33:59 EST 2015


I reported this before, but now have new info.  This is matplotlib-1.5.0 on 
fedora 23.

Now I have installed anaconda, and am trying to use it.  Unfortunately, 
although anaconda has it's own version of stix, it seems mpl is still 
preferring the fedora versions which seem to cause this problem.

I believe it's because fedora uses otf fonts - anaconda has ttf fonts that 
might work.

How can I tell mpl to prefer the anaconda ones?

...
[finds fedora versions]

findfont: Matching 
:family=stix:style=normal:variant=normal:weight=400:stretch=normal:size=medium 
to STIX ('/usr/share/fonts/stix/STIX-Regular.otf') with score of 0.000000
...
[finds anaconda versions]

findfont: Matching 
:family=STIXNonUnicode:style=normal:variant=normal:weight=700:stretch=normal:size=12.0 
to STIXNonUnicode ('/home/nbecker/.local/lib/python3.4/site-
packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf') with score of 
0.000000
findfont: Matching 
:family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 
to STIXGeneral ('/home/nbecker/.local/lib/python3.4/site-
packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf') with score of 
0.000000
...
[seems to pick fedora version]

Assigning font /b'F1' = '/usr/share/fonts/stix/STIX-Regular.otf'
findfont: Matching 
:family=stix:style=normal:variant=normal:weight=400:stretch=normal:size=large 
to STIX ('/usr/share/fonts/stix/STIX-Regular.otf') with score of 0.000000
Embedding font /usr/share/fonts/stix/STIX-Regular.otf
...
Embedding font /usr/share/fonts/stix/STIX-Regular.otf
Writing TrueType font
Traceback (most recent call last):
  File "linear_awgn_ascma_vs_scma.py", line 28, in <module>
    plt.savefig ('test.pdf')
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/pyplot.py", line 688, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/figure.py", line 1539, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_qt5agg.py", line 196, in print_figure
    FigureCanvasAgg.print_figure(self, *args, **kwargs)
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backend_bases.py", line 2230, in print_figure
    **kwargs)
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_pdf.py", line 2542, in print_pdf
    file.close()
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_pdf.py", line 547, in close
    self.writeFonts()
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_pdf.py", line 650, in writeFonts
    fonts[Fx] = self.embedTTF(realpath, chars[1])
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_pdf.py", line 1125, in embedTTF
    return embedTTFType3(font, characters, descriptor)
  File "/home/nbecker/anaconda3/lib/python3.5/site-
packages/matplotlib/backends/backend_pdf.py", line 911, in embedTTFType3
    filename.encode(sys.getfilesystemencoding()), glyph_ids)
RuntimeError: TrueType font is missing table



More information about the Matplotlib-users mailing list