Download the PHP package aklump/dompdf-fonts without Composer
On this page you can find all versions of the php package aklump/dompdf-fonts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download aklump/dompdf-fonts
More information about aklump/dompdf-fonts
Files in aklump/dompdf-fonts
Download aklump/dompdf-fonts
More information about aklump/dompdf-fonts
Files in aklump/dompdf-fonts
Vendor aklump
Package dompdf-fonts
Short Description Simplify the usage of TrueType fonts with DomPDF.
License BSD-3-Clause
Homepage https://github.com/aklump/dompdf-fonts
Package dompdf-fonts
Short Description Simplify the usage of TrueType fonts with DomPDF.
License BSD-3-Clause
Homepage https://github.com/aklump/dompdf-fonts
Please rate this library. Is it a good library?
Informations about the package dompdf-fonts
DOMPDF Fonts
I wrote this project to simplify using custom fonts with DOMPDF.
Installation
composer require aklump/dompdf-fonts
- Create a directory in your project to hold the source fonts and the configuration file.
- Copy the config file found in vendor/aklump/dompdf-fonts/dompdf-fonts.config.dist.yml to the font folder as dompdf-fonts.config.yml.
In a Drupal Module
Installation
cd my_module
- Install as a dev requirement:
composer require --dev aklump/dompdf-fonts
mkdir fonts
cp vendor/aklump/dompdf-fonts/dompdf-fonts.config.dist.yml fonts/dompdf-fonts.config.yml
Importing
- Copy source font into
fonts/
. ./vendor/bin/import.php fonts/dompdf-fonts.config.yml
For example:
Get the .ttf font files
- Download one or more font families, say from https://fonts.google.com
- For use with DomPDF you only need the .ttf versions. Copy those to your source directory. In the examples shown below, that directory is ./fonts.
- You will need up to four versions of the font: normal, bold, italic and bold italic.
Example file tree.
Set the import configuration
- dompdf-fonts.config.yml should have been copied from dompdf-fonts.config.dist.yml when you installed this, if not you must manually do so now.
- Update dompdf-fonts.config.yml as appropriate. All paths are relative to dompdf-fonts.config.yml's parent directory.
File: _dompdf-fonts.config.yml
Run the importer
- Run
php vendor/bin/import.php path/to/dompdf-fonts.config.yml
to process your fonts. - Inspect to make sure your output directory contains the necessary files.
Use with Dompdf instances
- Set the fonts directory to match
output.path
on every new DOMPDF instance in your code. This is an example from a Drupal 9 module.
Use with HTML markup
- To see your font in the browser you must import the SCSS partial. When only rendering PDFs, DOMPDF does not use _style.scss.
_File: mymodule/scss/_pdf.scss
Resource Links
All versions of dompdf-fonts with dependencies
PHP Build Version
Package Version
Requires
dompdf/dompdf Version
^1.0|^2.0
symfony/yaml Version ^4.4|^5.4
symfony/filesystem Version ^4.4|^5.4
symfony/yaml Version ^4.4|^5.4
symfony/filesystem Version ^4.4|^5.4
The package aklump/dompdf-fonts contains the following files
Loading the files please wait ....