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

Path to fonts is hard coded #5

Open
Norore opened this issue Jun 2, 2020 · 2 comments
Open

Path to fonts is hard coded #5

Norore opened this issue Jun 2, 2020 · 2 comments

Comments

@Norore
Copy link

Norore commented Jun 2, 2020

First of all: thank you very much for this patch, it save me a lot of hours!

I just had a problem with the path to fonts used to generate the PDF in production, in a Symfony 3.4+ project. Path seems to be hard coded in *.php and *.dat files in font/unifont folder, as see in this answer from StacOverflow: https://stackoverflow.com/a/38520012/1866679
After removing the incriminated files, my PDF is generated as wanted under production server.
Is there a way to avoid this trouble or did I have to avoid those files to be uploaded under production?

@JanSlabon
Copy link
Member

I'm with you. IMHO these files have nothing todo in this folder at all. Also individual font files should not be located in the vendor folder... but

This repository is only made for cloning official tFPDF releases which are available at: http://fpdf.org/en/script/script92.php THERE WILL BE NO DEVELOPMENT IN THIS REPOSITORY!"

So you should write a patch and send it to the FPDF forum so that Olivier has a chance to update the package accordingly. Keep backwards compatibility in mind.

@iwasherefirst2
Copy link
Contributor

@Norore you can define your default font path by define('FPDF_FONTPATH', $pathToYourFonts); which you can keep outside the vendor folder and track with your VCS. But you should make sure to not track *.php and *.dat files. Just add a .gitignore in this directory with

*.php
*.dat

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

3 participants