Welcome to CodeIgniter

Welcome to Fontbrain

Fontbrain is the largest database of fonts in the world with the coolest tools available and the coolest tools to come, all available through an API.

We've created several urls that interact with the API using a dummy font. These urls are available throughout the manual and also summarized here:

Try it out

Title Description
Home Returns to the homepage of the API manual
Reset This will delete the font from all the API's and delete all the images. Use this to completely start over. You can use some of the other get functions to test if it was successful.
Get from archives Gets the dummy font from our archive system and places the font file in the fonts API.
Push Push a font to the fonts API. The fonts API will then push it to the images API and the assimilator API.
Assimilate Assimilates a font by creating system fonts, generating data about features, glyphs, signatures etc. If assimilation fails more than 5 times it will ignore the request. If another request in in process to assimilate the font, this request will wait until it is finished up to a limit. If the limit is reached it will return failure. If it finished before the limit, it will return success.
Get dummy font info
Get dummy font assimilation info
Get Image Gets an image paths and information from the API. If it doesn't exist it will generate it. Compression happens later as the server can get to it.
Get Image File Returns the actual file of the image instead of the paths and outputs to the browser. You will need to use the back button to return to the manual.
Get fonts scale Get the current scale of the font.
Update font scale
Get generation stats
Test Drive
Delete the font and all the records
Delete images for dummy font
Delete Dumby Font


API Response

If the call was successful, only the actual response will show. If the call failed, the entire response, including errors will be displayed.

No API call was made.
=============================================

REST Test

=============================================

Request

http://testing.imgs.fontbrain.com/index.php/api/image/id/2516b34268d5abb314bd31734f2391d0/format/json?hash=18b2118103a09ad90dd2c0c7b9fe77f5&retina=0&recipe%5Bimage_type%5D=pt&recipe%5Bwidth%5D=720&recipe%5Bheight%5D=360&recipe%5Bfg%5D=000000&recipe%5Bfont_size%5D=22&recipe%5Bcolumns%5D=14&recipe%5Bbg%5D=5f5562&font=2516b34268d5abb314bd31734f2391d0&generate_mode=1
=============================================

Response



{"status":"failed","error":"Unknown font","code":403}

=============================================

Call details

Array
(
    [url] => http://testing.imgs.fontbrain.com/index.php/api/image/id/2516b34268d5abb314bd31734f2391d0/format/json?hash=18b2118103a09ad90dd2c0c7b9fe77f5&retina=0&recipe%5Bimage_type%5D=pt&recipe%5Bwidth%5D=720&recipe%5Bheight%5D=360&recipe%5Bfg%5D=000000&recipe%5Bfont_size%5D=22&recipe%5Bcolumns%5D=14&recipe%5Bbg%5D=5f5562&font=2516b34268d5abb314bd31734f2391d0&generate_mode=1
    [content_type] => application/json; charset=utf-8
    [http_code] => 403
    [header_size] => 185
    [request_size] => 449
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.023471
    [namelookup_time] => 0.012465
    [connect_time] => 0.012577
    [pretransfer_time] => 0.012605
    [size_upload] => 0
    [size_download] => 55
    [speed_download] => 2343
    [speed_upload] => 0
    [download_content_length] => 55
    [upload_content_length] => -1
    [starttransfer_time] => 0.023442
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 173.255.225.176
    [certinfo] => Array
        (
        )

    [primary_port] => 80
    [local_ip] => 173.255.225.176
    [local_port] => 36836
)

Overview

There are 3 APIs available:

  • fonts.fontbrain.com
  • assimilator.fontbrain.com
  • imgs.fontbrain.com

fonts.fontbrain.com

A repository of every font we have with basic data about the font.

Only super users can push and pull fonts from this API. This API is mostly for the other two APIs to get font files and font info neccessary to generate images and data. There are some fonts that we have files for, but the information is not complete. If the fonts API needs a font that it doesn't have, it will get it from the archives, use the name table to populate the information the best it can.

assimilator.fontbrain.com

Takes a font file and creates all the data necessary for displaying fonts in a font commerce website. This includes information about the glyphs, OpenType features, language support, metrics, glyph signatures and optimized font files for image generation.

Any font added to the assimilator will be assimilated in the order it was received. Fonts that fail the assimilation process will be rejected after 5 attempts. Once a font is assimilated, the data is stored and remains available. If the data for a font is not requested after 1 month, the font is removed from the system.

imgs.fontbrain.com

Generates font images of the font. A checksum of the font and a recipe are sent to the API and a path to the image is returned. Recipes can be registered so that images are pre-generated when the system receives a new font. Images are compressed after generation as the system can get to them.

fonts.fontbrain.com

Tables

fonts example

Database field Example data Comments
checksum 2516b34268d5abb314bd31734f2391d0 A unique checksum of the font file.
family_name Sofia Pro This is the name used in some of the font image types when a font is representing the family
name Sofia Pro The name of the font (minus the stylename). This name is used in some of the image types when the image is clearly displaying the font and not the family.
style_name Black The stylename of the font
writing_system 3 The id of the writing system from the writing_systems table.
format otf the format of the source font
case mixed values can be mixed, upper, or lower
numerals Y if the font contains the numerals, the value should be set to Y
punctuation Y if the font contains the punctuation, the value should be set to Y
adddate 2017-07-17 15:34:27
editdate 2017-07-17 15:34:27

writing_systems example

Database field Example data Comments
id 3 Matches the writing_system field in the fonts database
key latin
name Latin

writing_systems data

3 latin Latin
4 arabic Arabic
5 bengali Bengali
6 devanagari Devanagari
7 gujarati Gujarati
8 gurmukhi Gurmukhi
9 hebrew Hebrew
10 japanese Japanese
11 tamil Tamil
12 thai Thai
13 dingbat Dingbat
14 kannada Kannada

Playground

Link Description
Try it Get font info from fonts.fontbrain.com from our dummy font