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 6, 2017 · 12 revisions

Simple & easy ways to contribute

More advanced ways to contribute

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. If the font exists only in Google Fonts, download the font sources from the Google Code project. Don't download from Google Fonts frontend 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.
    2. Rename the WOFF files to their corresponding weights (for example, Roboto-BoldItalic.woff should be renamed 700i.woff) and save them in fonts/[font-name]/.
  4. Add LICENSE and SOURCE files (follow the example of the existing fonts), and save them alongside the font files.
  5. Using the specimen.ai file provided in fonts/, create a specimen image. To do this, change the font of the text object, then convert to outlines, and export for web. Uncheck "Clip to Artboard" to shrink the image to fit.
    1. Export as a PNG with transparency enabled, and with a height of 200px. Save the image as fonts/[font]/specimen.png.
    2. Optimize the PNG losslessly.
  6. Add the font metadata in a file called _fonts/[font]/index.html. The data is stored in the YAML front-matter of this file; follow the format of other fonts in the repository.
  7. Commit the changes to the [master] branch (do not send pull requests to the [gh-pages] branch). There should only be additions in the commits (no deletions). If there are deletions, you're probably doing something wrong!
  8. 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)

Contributing to the code

You're all welcome to contribute to the code sections of Brick as well! Feel free to submit pull requests for any improvements or fixes.

A quick outline of the sections of code in the project (to make it easier for you to find something to work on):

  • brick.php: PHP/Liquid hybrid file used to generate CSS for a given request. The Liquid portion populates the $catalogue array of fonts and weights with the Jekyll metadata, while the PHP portion actually handles the requests themselves
  • index.html: Home page for Brick. Nothing much needs to be changed, except perhaps any typos.
  • _fonts/index.html: The catalogue page
  • _fonts/*/index.html: The font metadata files. Feel free to tweak the metadata if you think it needs improving (local font names, classification, etc.)
  • _layouts/page.html: The page layout used for the font catalogue and font specimen pages
  • _layouts/font.html: The font specimen template for each font.

If you want to change the design or layout of the site, please submit an image (screenshot or mockup) of the resulting de# the pull request. Even better, set up a live version of the site others can play around with.

Clone this wiki locally