Download the PHP package uxcode-fr/font-optimizer without Composer

On this page you can find all versions of the php package uxcode-fr/font-optimizer. 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 font-optimizer

Font Optimizer

Automate your web typography workflow with this Composer dev-tool.

Converts TTF fonts to optimized WOFF2 subsets using Python FontTools. Works with Laravel, Symfony, and vanilla PHP projects.

Screenshot

Prerequisites

Requires Python 3 and FontTools with Brotli support on your system.


Installation

After installation, Composer automatically checks that Python 3 and fontTools are available:

If the check fails, you will see:

The binary is available at vendor/bin/font-optimizer.


Configuration

Configuration is loaded from config/font-optimizer.php if present, otherwise from the extra section of composer.json.

Option A — config/font-optimizer.php (Laravel, Symfony, vanilla PHP)

Laravel — publish the default config:

Other projects — create the file manually at the root of your project:

Option B — composer.json extra section (all projects)

Configuration options

Key Description Allowed values Default
source Directory containing your source .ttf files Any path relative to the project root resources/fonts
destination Directory where output files will be saved Any path relative to the project root public/fonts
unicodes Unicode ranges to include in the subset — use * to keep all glyphs (no subsetting) Hex codepoints or ranges (U+0020-007F), comma-separated, or * Basic Latin + Latin-1 + Œœ
features OpenType layout features to preserve See OpenType feature tags, comma-separated, or * kern,liga
flavor Output font format woff2, woff woff2
name_ids Name table record IDs to keep Comma-separated IDs (0–19), or * *
hinting Keep hinting instructions true, false true

OpenType feature tags

Tag Description
kern Kerning adjustments between glyph pairs
liga Standard ligatures (fi, fl, ff…)
clig Contextual ligatures
calt Contextual alternates
ccmp Glyph composition / decomposition
locl Localized forms (language-specific glyph variants)
mark Mark positioning (diacritic placement)
mkmk Mark-to-mark positioning
case Case-sensitive forms (punctuation for all-caps)
frac Diagonal fractions (1/2, 3/4)
sups Superscript
subs Subscript
smcp Small capitals
onum Oldstyle figures
tnum Tabular figures
zero Slashed zero
ss01ss20 Stylistic sets

Unicode range examples

Range Characters
U+0020-007F Basic Latin (ASCII printable)
U+00A0-00FF Latin-1 Supplement (accented, ©, €…)
U+0100-017F Latin Extended-A (Œœ, Šš, Žž…)
U+0400-04FF Cyrillic
U+0370-03FF Greek and Coptic
U+2000-206F General Punctuation (—, …, ", "…)
U+20A0-20CF Currency Symbols (€, £, ¥…)

Usage

Output example:

Convert without subsetting

To convert TTF fonts to WOFF/WOFF2 without any subsetting (keep all glyphs), set unicodes to * and features to *:

Composer shortcut (optional)

Add to your composer.json:

Then run:


Why use this?


Articles


Authors

Contributing

Feel free to fork this repo and submit pull requests. For major changes, please open an issue first.

License: MIT


All versions of font-optimizer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
composer-runtime-api Version ^2.0
symfony/console Version >=6.0
symfony/process Version >=6.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 uxcode-fr/font-optimizer contains the following files

Loading the files please wait ...