Dompdf Install New Fonts On Mac
Dompdf moved recently to, and we also added Composer support. For this, we removed the reference to the required external library. Note: If you are using composer to install dompdf (and ), you need to put define('DOMPDFENABLEAUTOLOAD', false); in dompdfconfig.custom.inc.php. This will then allow composer to autoload which is installed through dompdf's composer.json file. Otherwise, you may still get an error. (See this ) If you are not using composer and want to use the latest edition of dompdf with this library:. Get the latest dompdf release from and extract it into a directory.
Download the library release also from. Create the dompdf/lib/php-font-lib/classes/ directory. In the zip file, take the contents of the src/FontLib/ folder and paste that into your newly created directory. While my edit is being reviewed, I'll post the details here for the latest dompdf 0.6.1 If you are using composer to install dompdf (and php-font-lib), you need to put define('DOMPDFENABLEAUTOLOAD', false); in dompdfconfig.custom.inc.php. This will then allow composer to autoload php-font-lib which is installed through dompdf's composer.json file.
Otherwise, you may still get an error. (See this Issue #636) If you are not using composer and want to use the latest edition of dompdf, you will need to manually install php-font-lib:. Get the latest dompdf release from and extract it into a directory. Download the library release also from. Create the dompdf/lib/php-font-lib/classes/ directory.
In the zip file, take the contents of the src/FontLib/ folder and paste that into your newly created directory.
I have a similar problem and i have been looking a solution for 2 days.With the new version, the accepted answer does not work any more. @jay-bienvenu answer is correct. The new version of DomPDF does not include everything and also there is a very poor documentation. So you will have to:. download loadfont.php and place it to the root directory of your project: curl -o loadfont.php. then open loadfont.php with your editor and place the correct path to your autoload.inc.php, eg requireonce 'lib/dompdf/autoload.inc.php';. Open the command line, go to the root folder of your project, and run the utility with the name of the font you are registering and the path to the TFF file eg php loadfont.php SourceSansPro./pathToYourFolder/lib/dompdf/SourceSansPro-Regular.ttf./pathToYourFolder/lib/dompdf/SourceSansPro-Bold.ttf Now the font is installed.
Install Mac Fonts On Pc
You may use it as you would normally would as a webfont in html. Dompdf's says the font utility is included but doesn't tell you how to get it and run it. Here's how:. Download to the root directory of your project.
Installing New Fonts On Mac
Curl -o loadfont.php. Open loadfont.php with a text editor (e.g. Change requireonce 'autoload.inc.php'; to requireonce 'vendor/autoload.php';. Run the utility with the name of the font you are registering and the path to the TFF file. For example: php loadfont.php 'Brush Script MT' https/fonts/brush-script-mt.ttf Read the code for for more information about how to use this command.