utils
utils copied to clipboard
load_font lost previous fonts
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.
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();
...