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

Example by Ian Back fails with True type font #28

Open
anbrusi opened this issue Feb 24, 2018 · 1 comment
Open

Example by Ian Back fails with True type font #28

anbrusi opened this issue Feb 24, 2018 · 1 comment

Comments

@anbrusi
Copy link

anbrusi commented Feb 24, 2018

$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);

// Load a UTF-8 string from a file and print it
$txt = file_get_contents('HelloWorld.txt');
$pdf->Write(8,$txt);

fails, because AddFont sets a font key "dejavu" while SetFont looks for "dejavusanscondensed". This is due to the fact, that within AddFont "dejavu" is replaced by "dejavusanscondensed" when dejavusanscondensed-font-metrics.php is included. Changing the last line in this file to $fontkey = 'dejavu' solves the problem. By the way, this is the value in the old file dejavusanscondensed.mtx.php.

@tonda13
Copy link

tonda13 commented Feb 22, 2019

I prepared fix because we need use some different font-family for DejaVu fonts.
#38

Pre-generated files was create and commit in these bf759ff before that was generated for each call of method AddFont().

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