Online font converter

The online font converter is a very simple API. It takes two or three parameters: The original file that should be converter, What format it should be converted into And the callback parameter that tells what to do when it has been converted if you are using the method "convertFont". If you use the directConvertFont it will return a binary file, rename the file to something.tar.gz and unpack it.

The source file

The file can be in almost any font format, even a PDF!

The target format

Enter your wanted extension of the format you wish to convert the font to.

Here is some of the extension that is suported: dfont, eot, otf, pfb‚ tfm‚ pfm‚ suit‚ svg‚ ttf‚ pfa‚ bin‚ pt3‚ ps‚ t42‚ cff‚ afm‚ ttc‚ woff

The callback

The callback can be an E-mail or an url. If you enter an URL you need to take care of the file when it arrives back to your server. When the conversion is complete it will POST back to the url you have given. The file is simply named "file" and there is a second post field named "originalFileName". If you wish to keep track of wich format that is converted when it arrives back to your server, I suggest you add a query parameter to the callback URL for example: http:// domain.com/callback.php?conversionId=123

A simple PHP script that receiv a finish conversion can look like this:

<?php
// sample script that only prints the POST result

print_r($_FILES);
/*
Outputs:
 Array
 (
    [file] => Array
        (
            [name] => Geogrotesque-SemiBold.pfb
            [type] => application/octet-stream
            [tmp_name] => /tmp/phpRHF74I
            [error] => 0
            [size] => 42816
        )

 )
*/

print_r($_GET);/*
Outputs:
Array
(
)
*/

print_r($_POST);
/*
Outputs:
Array
(
   [originalFileName] => style_169898.ttf
)
*/

?>

Here is a working curl example to use directConvert using curl:

curl --request POST 'https://ofc.p.mashape.com/directConvert/' --header "X-Mashape-Authorization: YOUR_API_KEY" -F format=TARGET_FONT_FORMAT -F file=@"/PATH/TO/SOURCE/FONT.ttf" > /PATH/TO/new_font.tar.gz

tar -xvf new_font.tar.gz

Visit http://onlinefontconverter.com/ to just convert fonts online. Please consider donate if you like this service!

Last 7 days, UTC

Average Latency
858ms

Average Uptime
100.0%

Current Status
Online

  • No information
  • Outage
  • Disruption
  • Normal
Average latency determined from Mashape to API Response time

Endpoints

HTTP 200 : binary POST/directConvert/
DirectConvertFont

the returned binary file is a .tar.gz


Test console
Description
Parameter
binary

fontfile

file

Required

string

Does not currently support multiple conversion at the same time, pick One of: dfont, eot, otf, pfb‚ tfm‚ pfm‚ suit‚ svg‚ ttf‚ pfa‚ bin‚ pt3‚ ps‚ t42‚ cff‚ afm‚ ttc‚ woff
Example: woff

format

Required

Consume this API completely for free!


By joining the mashape API marketplace you can start using Online font converter API today!

Login to your account or signup: Create Account

or
   Signup with GitHub

By signing up you agree to our terms of service.