fpdf adding a new font to my report - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: fpdf adding a new font to my report (/thread-33409.html) |
fpdf adding a new font to my report - KatMac - Apr-23-2021 Hi I have created a class to set up the headers and footers for my pdf file. In my header function inside the class, I would like the heading 'Book Inventory' to be in a different font. I downloaded the font 'Good Vibes' and installed this in the windows->fonts folder on my computer. The code I have in my .py file is: ''' self.add_font("Good Vibes Regular", "", "great-vibes.regular.ttf", uni=True) self.set_font("Good Vibes Regular", "", 14) ''' When I run my code, the following error displays: ''' raise RuntimeError("TTF Font file not found: %s" % fname) RuntimeError: TTF Font file not found: great-vibes.regular.ttf ''' Not sure what I have done wrong. |