Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined path to font is ignored #166

Open
Xitroy opened this issue Oct 31, 2020 · 1 comment
Open

User defined path to font is ignored #166

Xitroy opened this issue Oct 31, 2020 · 1 comment

Comments

@Xitroy
Copy link

Xitroy commented Oct 31, 2020

When you want to add_font from a custom path it is impossible to do, because add_font() function will get 'ttffile' from Fontfile.ttf, which is ususally ./fonts/Fontfile.ttf

Instead, you should define self.fonts[fontkey] = { ... 'ttffile': font_dict['ttffile'], ... } like in following snippet: self.fonts[fontkey] = { ... 'ttffile': ttffilename ... }, what will really refer on custom path to user font file.

Actually, even the original solution could work if you put your fonts into:
./fonts/Fontfile.ttf
But it is not expected behavior (i guess) if your custom path will be redirected in further logic.

@Lucas-C
Copy link

Lucas-C commented Jan 9, 2021

FYI, this was fixed in fpdf2: https://alexanderankin.github.io/pyfpdf/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants