Search code examples
fontsfont-facetruetypewebfontswoff

TTF (truetype) to WOFF(webfont) conversion using ruby


How do you convert a .ttf file to .woff file (webfont) using ruby?

We want to allow users to upload a ttf file, convert it and embed the woff file.


Solution

  • There are two tools available to convert TTF to WOFF.

    1. sfnt2woff - found here: http://people.mozilla.com/~jkew/woff/ - This is a command line tool that you should be able to call from Ruby

    2. sfntly - found here: http://code.google.com/p/sfntly/ - This is a command-line Java suite developed by Google to do a bunch of font tasks, including WOFF generation.