I'm trying to use the python package fpdf2 to generate a pdf using my python app.
But it gives me the error python pyfpdf Undefined font: dejavusanscondensedB - Use built-in fonts or FPDF.add_font() beforehand
when I try to use a custom font.
here are my code
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.add_font(fname="DejaVuSansCondensed.ttf")
pdf.set_font('DejaVuSansCondensed', size=14)
.......
......
pdf.output(f"{instance.app_user.first_name} {instance.app_user.last_name} - {time}.pdf")