Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Milestone
Description
The code posted below will return the following:RuntimeError: TrueType font is missing table . It looks like TTC files have replaced TTF files for many fonts in Windows 8. Please consider adding support. Thanks so much,
MJ
importmatplotlib.pyplotasPLTimportpylabasPYLABfrommatplotlib.backends.backend_pdfimportPdfPagesasPDFimportmatplotlib.font_managerasfmfontFile=r'C:\Windows\Fonts\msyh.ttc'fp1=fm.FontProperties(fname=fontFile)reportFile=r'C:\Temp\TestUnicodeJA.pdf'pdfOutput=PDF(reportFile)vals=range(100)PLT.plot(vals,vals,color="r",linestyle="-")mess=u'\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059....'PYLAB.xlabel(mess,fontproperties=fp1)PLT.savefig(pdfOutput,format='pdf')PLT.close()pdfOutput.close()