Skip to content
DIY @font-face web service.
Find file
New pull request
Latest commit 73359bf @croaky croaky Bump to 1.0.2

Fist Face

DIY @font-face web service.


In your web app:

<link href="" rel="stylesheet" type="text/css">

Replace the href with the URL of your @font-face web service.


  • Fixes the Access-Control-Allow-Origin problem in Firefox and other browsers
  • HTTP caches fonts so they are downloaded only once by the same browser
  • Content-Type always correct for .ttf, .otf, .woff, .eot, and .svg fonts


Create a Gemfile:

source ''
gem 'sinatra',  '~> 1.1'
gem 'fistface', '~> 1.0'

Create a rackup file (

require 'rubygems'
require 'bundler'
run Sinatra::FistFace
run Sinatra::Application

Prepare the app for production:

bundle install
git init
git add .
git commit -m 'Creating a Fist Face instance'

Create the production environment. Use Heroku's Bamboo stack in order to use Varnish:

heroku create your-app-name-here --stack bamboo-mri-1.9.2

Add your S3 bucket:

heroku config:add S3_URL=

Do not include a trailing slash.

S3_URL is the URL of the asset host which stores your @font-face definitions in CSS files.

For each font you want to serve, upload a CSS file to your asset host like:

@font-face {
  font-family: 'Chunk';
  font-weight: normal;
  font-style: normal;
  src: local('☺'), url('') format('truetype');

Fist Face uses a directory-and-file convention like this:


It is up to you to determine how many formats you need to include in your CSS file.

Upload each font file using that convention.

Deploy your @font-face web service:

git push heroku master

Start serving fonts!


Please use Github Issues and Pull Requests for any patches.

To run the Sinatra app locally:

gem install bundler
bundle install
S3_URL= rackup

To run the specs:

rspec spec/app_spec.rb



Fist Face is maintained and funded by thoughtbot, inc

Thank you to all the contributors!

The names and logos for thoughtbot are trademarks of thoughtbot, inc.


Fist Face is Copyright © 2010-2013 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

Something went wrong with that request. Please try again.