Download the PHP package smtws/google-font-downloader without Composer
On this page you can find all versions of the php package smtws/google-font-downloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smtws/google-font-downloader
More information about smtws/google-font-downloader
Files in smtws/google-font-downloader
Package google-font-downloader
Short Description php google fonts downloader with local css creation
License MIT
Informations about the package google-font-downloader
gFontDownloader
php google fonts downloader with local css creation
Configuration via 3 options
- set Configuration in config.json and just call ->setConfig();
- set configuration via ->setConfig([array of configuration key value pairs]);
- set configuration via ->setConfig($key,$value);
combinations are possible
configurables:
- output: directory where fonts are downloaded to (each font family will have its own subdirectory) defaults to ./
- formats: optional array of font formats to be downloaded, defaults to all valid values. valid: eot,woff,woff2,svg,ttf
- onRecoverableError: how to handle recoverable errors. valid: stop(default), recover
add Fonts to Download list:
-
->addFont(string $fontFamily,string $fontStyle, array $fontWeights);
or
-
->addFontByUrl(string $urlOfFont);
(e.g. "https://fonts.google.com/?selection.family=Gelasio:500i,700|Open+Sans|Roboto" or "https://fonts.googleapis.com/css?family=Gelasio:500i,700|Open+Sans|Roboto&display=swap")
run:
->download();
returns array of all downloaded fonts
accepts callback function which is passed information on each font individually
more:
-
PSR3 compatible loggers can be used
->setLogger(new \PSRCompatibleLogger());
-
run ->createFamilyCssFiles()
on unrecoverable errors to create Font Family CSS files that were successfully downloaded before the error occured (see example.php)