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
#1
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.
Reply


Messages In This Thread
fpdf adding a new font to my report - by KatMac - Apr-23-2021, 02:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to download TLS Report attachment blason16 6 456 Feb-26-2024, 07:36 AM
Last Post: Pedroski55
  Allure Report Generation rotemz 0 751 Jan-24-2023, 08:30 PM
Last Post: rotemz
  Right to left alignment in python report using Reportlab jalal0034 1 1,763 Sep-27-2022, 04:25 AM
Last Post: jalal0034
  Label Maker FPDF, Reportlab jamesaarr 1 2,603 Aug-09-2021, 11:57 PM
Last Post: Pedroski55
  Print Report Invoice nio74maz 0 1,537 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  fpdf orientation not working properly KatMac 1 3,259 May-02-2021, 10:47 AM
Last Post: Pedroski55
  fpdf star character issue KatMac 3 2,919 May-01-2021, 06:22 PM
Last Post: KatMac
  ModuleNotFoundError: No module named 'fpdf' KatMac 4 11,021 Apr-19-2021, 01:23 PM
Last Post: KatMac
  Load external font and does not show font in the window ATARI_LIVE 16 7,982 Feb-05-2021, 10:36 PM
Last Post: EthanPayne
  FPDF question DPaul 2 2,698 Oct-27-2020, 08:26 AM
Last Post: DPaul

Forum Jump:

User Panel Messages

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