Adding script driven font loading example for pdfdom
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.
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.
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.