Everything Fonts Subsetting API

Home / API / Everything Fonts Subsetting API

Font Subsetting API allows you to easily subset fonts using REST API. Use our API to get the range subsets and use the ranges in the subet call..

API End Points

The end point for connecting : If you subscribe directly from us use this endpoint.
	http://font.rest/
	

Authentication

Currently we support API Key based authentication. Please set a request header 'X-EverythingFonts-Api-Secret' with value of your API key. Alternatively you can also pass api_key= as a request parameter, though we strongly discourage this mode of passing the key.

Adding fonts to the system private ratelimited

To do any operations on a font file it has to be added to our system first. This will exist in your account and no one else can see or access this resource. Once you add the file you can refer to the font using the id returned from the API call.

POST/font

Add the font to the system.

Parameters
Parameter NameParameter TypeDescription
fontbinaryFont file to upload.
output
The result is a json object with an id for the uploaded font file.

To add a font to the system do a post with the font file attached to the following url.

	http://font.rest/font.json
	

Here is an example of adding a font using CURL to post to the API

	curl -v  -i -X POST  -H 'X-EverythingFonts-Api-Secret: <api_key>' -F font=@myraid.ttf http://font.rest/font.json
	

The above call if successful will return a json response something like this.

	{
	    "success": {
		"total": 1
	    },
	    "contents": {
		"id": "BMruFarhaMcvj6oGeAb62itgeF"
	    }
	}
	
The id in the contents is the font id that you should use in any of the subsequent calls.

Listing fonts in the system private ratelimited

To list the fonts in the system use the following API.

http://font.rest/font/list.json

By using the parameter "start" you can browse all the fonts(that you have added before) in the system. Use the parameter "public" to control whether to include public fonts or not in your list.

http://font.rest/font/list.json?start=10&public=0

Here is an example of listing the fonts using curl.

curl  -X GET -H 'X-Everythingfonts-Api-Secret: '  "http://font.rest/font/list?start=10&public=0"

The above command will return a result something like the following.

{
    "success": {
        "total": "75",
        "count": 11,
        "range": {
            "start": 10,
            "end": 21
        }
    },
    "contents": {
        "contents": [
            {
                "name": "IM FELL French Canon PRO Regular",
                "id": "RQMdiZs_C7IdyHPBV_FpGAeF",
                "private": "1",
                "created_on": "2014-12-18 19:20:23"
            },
            {
                "name": "IM FELL French Canon PRO Italic",
                "id": "i79KlUe2mpnLKg2I9kAWIAeF",
                "private": "1",
                "created_on": "2014-12-18 19:20:23"
            } ...
        ]
    }
}

Getting the subset ranges private ratelimited

GET/font/subset/ranges

Get the subset unicode ranges.

Parameters
Parameter NameParameter TypeDescription
output
The result is a json object with all the unicode subset ranges for your reference. You can then use this information to pass the correct ranges while making the subsetting call.

To get the subset ranges use the following endpoint
	http://font.rest/font/subset/ranges.json
	
Here is an example of getting the subset ranges using CURL.
	curl -v  -i -X GET -H 'X-EverythingFonts-Api-Secret: <api_key>' http://font.rest/font/subset/ranges.json
	

Subsetting the font private ratelimited

GET/font/{id}/subset

Subset the font.

Parameters
Parameter NameParameter TypeDescription
glyphsstringRequired. Comma seperated glyph ranges or single glyphs. e.g 0x61-0x7A,0x30-0x39
binaryresultbooleanReturn converted file in binary format, the default is base64 json response.
custom_glyphsstringA literal string whose value will be converted to unicode values. If the paramater use_cssrange is set to true this will be treated as CSS unicode ranges.
use_cssrangebooleanAffects how the custom_glyphs string is processed. Default is set to false.
output
The result file in base64 encoded json response or a binary font/zip file.

To subset the just added font use the following endpoint.
	http://font.rest/font/{fontid}/subset.json
	
Here is an example of subsetting the above ttf font. Since binaryresult is set to 0 the converted file will be returned as part of a json object as base64 encoded string.
	curl -v  -i -X POST  -H 'X-EverythingFonts-Api-Secret: <api_key>' -d glyphs=0x61-0x7A,0x30-0x39 -d binaryresult=1 -o subset.zip  http://font.rest/font/BMruFarhaMcvj6oGeAb62itgeF/subset.json
	

Subscribe

Everything Fonts Subsetting API Basic

$4.99/mo

No contracts. Anytime cancellation.
1 API Key
1000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning

Everything Fonts Subsetting API Premium

$9.99/mo

No contracts. Anytime cancellation.
1 API Key
4000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning

Everything Fonts Subsetting API Ultra

$24.99/mo

No contracts. Anytime cancellation.
1 API Key
12000 API Calls / day
Best in class backend tools
Easy to use REST API
Immediate provisioning