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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with Allure report Nik1811 0 123 Apr-22-2024, 09:59 AM
Last Post: Nik1811
  Unable to download TLS Report attachment blason16 6 550 Feb-26-2024, 07:36 AM
Last Post: Pedroski55
  Allure Report Generation rotemz 0 788 Jan-24-2023, 08:30 PM
Last Post: rotemz
  Right to left alignment in python report using Reportlab jalal0034 1 1,841 Sep-27-2022, 04:25 AM
Last Post: jalal0034
  Label Maker FPDF, Reportlab jamesaarr 1 2,668 Aug-09-2021, 11:57 PM
Last Post: Pedroski55
  Print Report Invoice nio74maz 0 1,576 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  fpdf orientation not working properly KatMac 1 3,340 May-02-2021, 10:47 AM
Last Post: Pedroski55
  fpdf star character issue KatMac 3 3,000 May-01-2021, 06:22 PM
Last Post: KatMac
  ModuleNotFoundError: No module named 'fpdf' KatMac 4 11,194 Apr-19-2021, 01:23 PM
Last Post: KatMac
  Load external font and does not show font in the window ATARI_LIVE 16 8,170 Feb-05-2021, 10:36 PM
Last Post: EthanPayne

Forum Jump:

User Panel Messages

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