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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
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

  1. composer require aklump/dompdf-fonts
  2. Create a directory in your project to hold the source fonts and the configuration file.
  3. 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

  1. cd my_module
  2. Install as a dev requirement: composer require --dev aklump/dompdf-fonts
  3. mkdir fonts
  4. cp vendor/aklump/dompdf-fonts/dompdf-fonts.config.dist.yml fonts/dompdf-fonts.config.yml

Importing

  1. Copy source font into fonts/.
  2. ./vendor/bin/import.php fonts/dompdf-fonts.config.yml

For example:

Get the .ttf font files

  1. Download one or more font families, say from https://fonts.google.com
  2. 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.
  3. You will need up to four versions of the font: normal, bold, italic and bold italic.

Example file tree.

Set the import configuration

  1. 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.
  2. 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

  1. Run php vendor/bin/import.php path/to/dompdf-fonts.config.yml to process your fonts.
  2. Inspect to make sure your output directory contains the necessary files.

Use with Dompdf instances

  1. 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

  1. 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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aklump/dompdf-fonts contains the following files

Loading the files please wait ....