Download the PHP package finesse/web-fonts-repository without Composer

On this page you can find all versions of the php package finesse/web-fonts-repository. 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 web-fonts-repository

Web fonts repository

Latest Stable Version Total Downloads PHP from Packagist Test Status Maintainability Test Coverage

A simple webfont hosting inspired by Google Fonts. It runs on your server, stores and distributes webfont files and generates CSS on-the-go for embedding fonts on web pages.

Quick start

Requirements

  1. HTTP server supporting PHP ≥ 7.0
  2. Composer (required for installation)

Installation

1. Download the source code

Run the following code in the console:

Where webfonts is a path to a directory where the repository should be installed.

Or you can make some things manually:

  1. Download the source code from GitHub and extract it.
  2. Open a terminal and go to the source code root.
  3. Install the libraries by running in the terminal:

  4. Prepare the repository by running in the terminal:

2. File permissions

Give the user behalf which the web server runs permissions to write inside the logs directory.

You can just run this in the console:

3. Web server

Make the directory public be the document root of the web server. Or just open http://localhost/public if you installed the repository to the web server root.

Make all the requests to not-existing files be handled by public/index.php. If your server is Apache, it's already done.

Make the server add the Access-Control-Allow-Origin: * HTTP-header to the font files. Otherwise some browsers will reject using fonts from the repository.

Setup

Put your font files (woff, woff2, ttf, otf, eot, svg) to the public/fonts directory. You may separate them by subdirectories. You can convert webfont files using Transfonter.

All settings go to the file config/settings-local.php. If you don't have it, copy it from the file config/settings-local.php.example.

Parameters:

displayErrorDetails

Whether errors details should be sent to browser. Anyway errors are written to the file logs/app.log. You should turn it off on production server.

logger/level

How many messages should be logged to the file. The value is one of the \Psr\Log\LogLevel constants. You can read more about log levels here.

fonts

The list of fonts available in the repository. Simple example:

The fonts array keys are the font families names. The styles arrays keys are the styles names. The numbers in the style names are the font weights, i stands for italic.

The font file paths are given relative to the public/fonts directory. The file paths are the glob search patterns. It means that the repository should consider all files matching the pattern as font files.

You can find more examples and possibilities here.

Usage

Add a <link> tag to the HTML code of the page on which you want to embed a font:

Where http://web-fonts-repository.local is the root URL of an installed web fonts repository.

The required fonts are specified the same way as on Google Fonts. Font families are divided by |, families styles are divided by ,, family name is separated from styles list using :.

You may omit the styles list. In this case the regular style (400) is used.

You can specify a value for the font-display style property using display parameter. Example:

Then embed a font in a CSS code:

Versions compatibility

The project follows the Semantic Versioning.

It means that patch versions are fully compatible (i.e. 1.2.1 and 1.2.2), minor versions are backward compatible (i.e. 1.2.1 and 1.3.2) and major versions are not compatible (i.e. 1.2.1 and 3.0). The pre-release versions (0.*) are a bit different: patch versions are backward compatible and minor versions are not compatible.

License

MIT. See the LICENSE file for details.


All versions of web-fonts-repository with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
slim/slim Version ^3.1
slim/php-view Version ^2.0
psr/log Version ^1.0
apix/log Version ^1.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 finesse/web-fonts-repository contains the following files

Loading the files please wait ....