Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install The CSS3 Font Converter (http://www.useragentman.com/blog/the-css3-font-converter/) on OS X Yosemite for on demand @font-face conversion on the command line. Also see http://cfxdesign.com/css3-font-converter-is-a-command-line-font-face-converter
1. $ brew install fontforge ttf2eot ttfautohint
2. $ brew tap bramstein/webfonttools && brew install sfnt2woff
3. Download/clone https://github.com/google/woff2 into any handy dir
cd into dir and:
$ git submodule init
$ git submodule update
$ make clean all
then:
$ ln -s /path/to/woff2_compress /usr/local/bin/woff2_compress
$ ln -s /path/to/woff2_decompress /usr/local/bin/woff2_decompress
4. Download/clone https://github.com/zoltan-dulac/css3FontConverter into /usr/local/bin/css3FontConverter
5. Add these two lines to ~/.profile
# Convert TTF/OTF font to @font-face font stack
alias fontstack='/usr/local/bin/css3FontConverter/convertFonts.sh'
6. Restart your Terminal
7. In Terminal, cd into the dir containing your font and run:
$ fontstack font-to-convert.ttf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment