utils icon indicating copy to clipboard operation
utils copied to clipboard

Adding script driven font loading example for pdfdom

Open woodyhayday opened this issue 5 years ago • 2 comments

I've added an example of loading fonts from in-script (like load_fonts.php does via command line). Based on the many stack overflow questions I hit, I think this may be useful for some users who (like we did) need to install fonts on the fly.

woodyhayday avatar Jan 23 '20 13:01 woodyhayday

The latest version of Dompdf supports numeric font weights. I wonder how much work it would be to update the script to do that?

Also, I wonder if we can simplify things a bit by calling FontMetrics::registerFont in place of some of the logic currently in the script.

Might be worthwhile to merge this with load_font.php so that it supports both command-line and script execution. We could try SAPI detection to determine whether or not to execute the installation method.

bsweeney avatar Feb 01 '20 04:02 bsweeney

The latest version of Dompdf supports numeric font weights. I wonder how much work it would be to update the script to do that?

Not sure how much work to add numeric font weight support - though as this is based on load_fonts.php I suspect that'd need it adding also?

Also, I wonder if we can simplify things a bit by calling FontMetrics::registerFont in place of some of the logic currently in the script.

Good point.

Might be worthwhile to merge this with load_font.php so that it supports both command-line and script execution. We could try SAPI detection to determine whether or not to execute the installation method.

I found it quite useful as a standalone script, but agree, could be merged.

woodyhayday avatar Feb 12 '20 09:02 woodyhayday