Download the PHP package webeau/typekit without Composer

On this page you can find all versions of the php package webeau/typekit. 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 typekit

webeau/typekit

Typekit Client implementation with PHP

Install

Via Composer

Usage

Initialize the client with your developer API token. You can get your API token here. All method calls return the JSON representation of the return from calling the Typekit API.

Get all kits

To get all your kits, use the following command:

Get kit

To get information about a specific kit, input the kit id as the argument:

Create kit

To create a new kit, use the method createKit($name, $domains, $families, $optimize=null). Name and domains fields are required, but the families and optimize fields are not.

The arguments are in the following format:

An example of the families format is: $families = [['id' => 'ftnk', 'variations' => 'n3,n4'], ['id' => 'pcpv', 'variations' => 'n4']] in which case we would create a kit with the font families Futura-PT and Droid Sans with font variations normal 3 ($font-weight:300 and not italicized or strong), normal 4 and normal 4, respectively.

Example usage:

$name = 'example typekit kit';

$domains = ['localhost', '*.domain.com'];

$families = [['id' => 'ftnk', 'variations' => 'n3,n4'], ['id' => 'pcpv', 'variations' => 'n4']];

$typekit->createKit($name, $domains, $families);

Update kit

To create a new kit, use the method updateKit($kitId, $name='', $domains=[], $families=[], $optimize=null). The only required field is $kitId and name. domains and families fields are not required.

Field formats are the same as createKit.

Example usage:

$name = 'Example';

$typekit->updateKit($kitId, $name);

Remove kit

To remove a kit, use the method removeKit($kitId). The $kitId field is required.

Publish kit

To publish a kit, use the method publishKit($kitId). The $kitId field is required.

Get font family

To retrieve information regarding a given font family, use the method getFontFamily($font). The argument font is a string and can be a Typekit font id or a slug of the font as named in Typekit. The method does not slugify the input, so make sure to slugify it before entering the argument.

Get font variations

To retrieve all possible variations of a given font, use the method getFontVariations($font). The argument is the same as for getFontFamily($font). This method returns a PHP array of all possible variations of the font.

$variations = $typekit->getFontVariations('futura-pt'); # using font slug

or

$variations = $typekit->getFontVariations('ftnk'); # using font id

OUTPUT:
['n3', 'i3', 'n4', 'i4', 'n5', 'i5', 'n7', 'i7', 'n8', 'i8']

Add font to kit

To add font to kit, use the method kitAddFont($kitId, $font, $variations). Arguments for this method is the same format as the ones above, BUT variations should be in array. Returns nothing.

Remove font from kit

To add font to kit, use the method kitRemoveFont($kitId, $font). Arguments for this method is the same format as the ones above, BUT variations should be in array. Returns nothing.

Other methods

optimizeKit($kitId, $optimize) - Set/unset optimized performance for a kit

getKitValues($kitId) - Retrieves kit values in an array of format: [$name, $domains, $families]

getKitFonts($kitId) - Retrieves an array of font ids in a given kit

kitContainsFont($kitId, $font) - Checks to see if a font exists in a kit.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please use Contact Form instead of using the issue tracker.

Credits

Thanks to

License

The MIT License (MIT). Please see License File for more information.


All versions of typekit with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle 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 webeau/typekit contains the following files

Loading the files please wait ....