I'm having a tough time trying to get something working which I think should be straightforward.
I'm new to python and learning via projects which in this case is a simple PDF generator. I want to add custom fonts to my program (Poppins) and I can get it to work if I include the fonts in the exact location as main.py, but ideally, I want these stored in a separate folder.
I've tried numerous suggestions but nothing has worked for me yet. Such as:
__init__.py
file in the main directory with the following import sys
sys.path.insert(1, '.')
__init__.py
file in the font directoryI've attached a screenshot of my code below along with the error message. Thanks in advance for any support.
From the add_font documentation of FPDF:
Note: the font source files must be accessible. They are searched successively in (if these constants are defined):
FPDF_FONTPATH
(by default, the font folder in the fpdf package directory)
SYSTEM_TTFONTS
(e.g. C:\WINDOWS\FONTS)