Download the PHP package jbtronics/dompdf-font-loader-bundle without Composer

On this page you can find all versions of the php package jbtronics/dompdf-font-loader-bundle. 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-font-loader-bundle

Font loader for dompdf Bundle

This bundle provides a simple way to load/install fonts of your choice for the dompdf library in a symfony project. This bundle offers functionality to load font families programmatically or automatically on cache warmup. You can specify each font family with a name and a path to the font files or you let the bundle autodiscover all fonts in a directory.

Feautures

Requirements

Installation

  1. Install the bundle composer require jbtronics/dompdf-font-loader-bundle
  2. Enable the bundle in your config/bundles.php (normally done by Symfony flex automatically)
  3. Put the font TTF files you want to use in a directory the webserver can access (preferably somewhere in your project folder)
  4. Add a config file config/packages/jbtronics_dompdf_font_loader.yaml, with the content described below (and changed according to your need)

Configuration

The fonts and autodiscovery keys are both optional, but at least one of them is required to load fonts.

Usage

When you have enabled the auto_install option, you do not have to do anything else, the fonts will be loaded automatically on cache warmup (when php bin/console cache:clear is run). The bundle will copy the font files to the dompdf font directory, create font metrics and register them in the dompdf library.

Autodiscovery

The autodiscovery mechanism will scan the configured directories for TTF files and register them as font families with the name of the font file. It also tries to detect the type of the font based on a suffix: _bold or _b will be detected as bold fonts, _italic, _i as italic fonts, and _bold_italic or _bi as bold italic. So the my_font_bold.ttf will be registered as bold font of the my_font family and so on, while my_font.ttf will be registered as normal font of the my_font family.

In principle dompdf should be able to use OTF files as well, however in my tests it did not work, so autodiscovery only detects TTF files by default. You can change the detected file types via the autodiscovery.file_pattern option.

Specify DOMPDF font location

Dompdf has its own font directory, where it stores the font files and metrics. This is configured on a per instance basis on a dompdf object with the set_option('fontDir', $path) method. To specify the font directory for the dompdf instance used by this bundle, you must decorate the DompdfFactoryInterface and configure the object in the create() method:

Manual font loading/installation

This bundle offers the DompdfFontLoader service, which can be used to install font families manually. You can either install a single font family with the installFontFamily() method or install all found fonts in a folder with the autodiscoverAndInstallFonts() method.

License

This bundle is licensed under the MIT license. See LICENSE for details.

Credits


All versions of dompdf-font-loader-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
symfony/framework-bundle Version ^6.0|^7.0
dompdf/dompdf Version ^1.0.0|^2.0.0|^3.0.0
symfony/finder Version ^6.0|^7.0
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 jbtronics/dompdf-font-loader-bundle contains the following files

Loading the files please wait ....