reportlab.pdfbase.ttfonts.TTFError: Can't open file "Times New Roman.ttf"

reportlab.pdfbase.ttfonts.TTFError: Can't open file "Times New Roman.ttf"

我在 ReportLab python

中导入 font times new roman 时遇到问题
pdfmetrics.registerFont(TTFont('TNR', 'Times New Roman.ttf'))
pdfmetrics.registerFont(TTFont('TNRB', 'Times New Roman Bold.ttf'))

你用错了filename

pdfmetrics.registerFont(TTFont('TNR', 'times.ttf'))
pdfmetrics.registerFont(TTFont('TNRB', 'timesbd.ttf'))