Skip to content

Instantly share code, notes, and snippets.

@rc1
Created April 9, 2013 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rc1/5346303 to your computer and use it in GitHub Desktop.
Save rc1/5346303 to your computer and use it in GitHub Desktop.
Converts OpenType fonts file to an Embedded OpenType file on the Mac. Tools installed via homebrew on Mac.
#!/bin/sh
# Convert an OTF font into TTF an EOT formats.
# @source: http://stackoverflow.com/a/2467452/179015
# @note: brew install fontforge
# brew install
# @usage: sh otf2ttf2eot.sh FontName
otfFont="$1.otf"
ttfFont="$1.ttf"
eotFont="$1.eot"
fontforge -c '
font = fontforge.open("'$otfFont'");
font.generate("'$ttfFont'");
quit(0);'
ttf2eot $ttfFont > $eotFont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment