reportlab.pdfbase.ttfonts.TTF错误:无法打开文件“ Times New Roman.ttf”

时间:2019-06-27 06:44:21

标签: python fonts reportlab

我在ReportLab python中导入字体时间新罗马字母时遇到问题

pdfmetrics.registerFont(TTFont('TNR', 'Times New Roman.ttf'))
pdfmetrics.registerFont(TTFont('TNRB', 'Times New Roman Bold.ttf'))

1 个答案:

答案 0 :(得分:0)

您使用的是错误的filename

pdfmetrics.registerFont(TTFont('TNR', 'times.ttf'))
pdfmetrics.registerFont(TTFont('TNRB', 'timesbd.ttf'))
相关问题