Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Contributing

Alfred Xing edited this page Mar 16, 2014 · 12 revisions

The simplest way to contribute is to suggest a font. Open up an issue for this!

Adding fonts via pull request

Our quality standards are very high, and thus, please follow the instructions carefully. These steps are difficult and take time; be prepared!

  1. Make sure the font is open source and its license is eligible for Brick (the SIL license and Apache license are okay, for others, read the license carefully).
  2. Make sure you have the original version of the font. These are usually downloaded from the author's website, GitHub, or the foundry's website. Don't download from Google Fonts or FontSquirrel unless you're sure they're the only places the font is hosted.
  3. Using FontForge, open the font and go to File > Generate Fonts... and save as "Web Open Font". Do not alter the font in any way!
    1. Note: Make sure you convert and upload all font styles and weights available in the family.
  4. Using the master.ai file provided in [gh-pages]/specimen, create a specimen image. Don't change the preview text. Showcase the different styles and weights of the font. Use the other images as guidelines.
    1. Export as a PNG with transparency enabled, and with a height of 150px.
    2. Optimize the PNG losslessly.
  5. Add the font to the catalogue file (cat.json).
    This is a standard JSON object. Under each font we find key-value paris. The key is the font weight and style (700i for bold italic, etc.), and the value is the local name of the font (find this in FontForge, under Element > Font Info > Name For Humans).
  6. Add the font to the website's font catalogue ([gh-pages]/fonts/index.html).
    Use the other fonts as examples; this should be pretty straightforward.
  7. Make sure you have the latest upstream version, then send a pull request!

Using a FontForge script to batch convert fonts

You can use a FontForge script to batch convert for step 3 above:

FontForge script (script.pe):

i=1
while ( i<$argc )
    Open($argv[i])
    Generate($argv[i]:r + ".woff")
    i = i+1
endloop

Usage: fontforge -script script.pe *.otf (replace *.otf with *.ttf if necessary)

Clone this wiki locally