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

load_font lost previous fonts #3

Open
Cyrille37 opened this issue Aug 20, 2017 · 1 comment
Open

load_font lost previous fonts #3

Cyrille37 opened this issue Aug 20, 2017 · 1 comment

Comments

@Cyrille37
Copy link

Cyrille37 commented Aug 20, 2017

Hi,
While trying to add several fonts to my projet I discover that load_font.php create the file dompdf_font_family_cache.php. This file is then used while rendering.

So when I added a second font with load_font.php then the file dompdf_font_family_cache.php missing the first added font, and render missing this first font.

How do you manage this case ?

The only solution I found is, before using load_font, copying dompdf_font_family_cache.php, then extract previous font definition, then copy it in the newly generated dompdf_font_family_cache.php.

Cheers.

@boxsnake
Copy link

Hi there. I found a workaround here:

Add this in function install_font_family as followings:

...
function install_font_family($dompdf, $fontname, $normal, $bold = null, $italic = null, $bold_italic = null) {
  $fontMetrics = $dompdf->getFontMetrics();
  $fontMetrics->loadFontFamilies();
...

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