Python Forum
fpdf adding a new font to my report
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fpdf adding a new font to my report

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.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print Report Invoice nio74maz 0 81 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  fpdf orientation not working properly KatMac 1 290 May-02-2021, 10:47 AM
Last Post: Pedroski55
  fpdf star character issue KatMac 3 320 May-01-2021, 06:22 PM
Last Post: KatMac
  ModuleNotFoundError: No module named 'fpdf' KatMac 4 696 Apr-19-2021, 01:23 PM
Last Post: KatMac
  Load external font and does not show font in the window ATARI_LIVE 16 1,845 Feb-05-2021, 10:36 PM
Last Post: EthanPayne
  FPDF question DPaul 2 392 Oct-27-2020, 08:26 AM
Last Post: DPaul
  Saving Report Names Kristenl2784 7 870 Jul-09-2020, 12:34 AM
Last Post: Kristenl2784
  how to generate html report for each folder using pytest ktrsarath 0 650 Jun-30-2020, 05:14 AM
Last Post: ktrsarath
  I need to get only string datatype and report in excel file. akshay3210 3 810 Dec-12-2019, 09:53 AM
Last Post: akshay3210
  python and py report different versions lordvold 3 874 Nov-27-2019, 11:01 PM
Last Post: lordvold

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020