reportlab pdfmetrics ttfont postscript error

Viewed 957

I'm experiencing an error when I try to register a font through pdfmetrics. Is there something I do not take into account or is it the font that could be the problem?

MY CODE

from reportlab.pdfbase import pdfmetrics
pdfmetrics.registerFont(TTFont('{FONT_NAME}', str({FONT_PATH}.ttf'))

ERROR TYPE:

TTFError

ERROR STRING:

TTF file "{FONT_PATH}.ttf": postscript outlines are not supported

ERROR FILE

/usr/local/lib/python3.5/dist-packages/reportlab/pdfbase/ttfonts.py

ERROR LINE

228


in file /usr/local/lib/python3.5/dist-packages/reportlab/pdfbase/ttfonts.py on line 228 the following error is raised:

if version==0x4F54544F:
    raise TTFError('%s file "%s": postscript outlines are not supported'%(self.fileKind,self.filename))
2 Answers

Just ran into this issue in MPDF (PHP PDF conversion library), and tried the converter linked in the accepted answer above, but the converted file still generated the error.

I ran the conversion in CloudConvert and that worked.

Related