reportlab

reportlab pdfmetrics ttfont postscript error


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))

Solution

  • Worked after converting the same font (that works on my machine) from OTF to TTF through this converter https://everythingfonts.com/otf-to-ttf