Typophile

How to build woff/web fonts from otf?

Rolf0 votes

Hello,

I was wondering which tools are available to create/convert web fonts from OTF (cff) files? I'm on OSX and it could be command line tools as well.
I know there are more than a few sites available that can do it for you, but I'm looking at fonts that I'd like to convert myself and also test with OT features.

I've looked at sfntly from Google but it's still a work in progress and also does not handle OTF/CFF fonts.
There's an (old) tool from JKew (http://people.mozilla.org/~jkew/woff/) but could not test it yet (the pre-compiled version doesn't run atm).

Any ideas or pointers?

Regards,
Rolf

Sfntly does indeed handle OTF/CFF fonts.

The FontSquirrel @font-face generator is certainly the best free tool around and it also offers a lot of extra options to deal with things like OpenType features: http://www.fontsquirrel.com/fontface/generator

But Fontsquirrel converts OTF/CFF to TTF.

FontForge

I ran the following test. I made an otf file without a UniquID (using ttx) that I named unicasem.otf and giving the following trace:

681 % otfinfo -i unicasem.otf
Family: unicase
Subfamily: Medium
Full name: unicase
PostScript name: unicase
Version: Version 001.000
Copyright: Created by Boyer Michel

and I sent it to the font-face generator to get my "package". In particular I received a ttf file. Here is a trace:

692 % otfinfo -i unicasem-webfont.ttf
Family: unicase
Subfamily: Medium
Full name: unicase Medium
PostScript name: unicase
Version: Version 001.000
Unique ID: FontForge 2.0 : unicase : 5-8-2012
Copyright: Created by Boyer Michel

Note the UniqueID that was put into the font by the fontface generator.

But Fontsquirrel converts OTF/CFF to TTF.

So? The original post only mentions creating webfonts from CFF.

As I recall, sfnt2woff (the JKew tool) can convert both OTF flavours to WOFF.

the pre-compiled version doesn't run atm

I just tried on my MacBook Pro with OS X 10.6 and had no problem running it. I first right clicked on the link and saved the file sfnt2woff.txt. Then I executed

mv sfnt2woff.txt sfnt2woff
chmod 755 sfnt2woff

and put sfnt2woff in my ~/bin directory (which is in my PATH).

Added: I just tried on a Mini and I directly got the file sfnt2woff but still had to use chmod to make it executable.

@Frank: Are you sure sfntly handles CFF? When I was playing with it last time (back in March) Brian (from the project) wrote: "[...] Currently sfntly can recognize the CFF table block but cannot take the CFF table apart or reassemble it; ie: cannot edit or subset it. We also want to subset OTF/CFF fonts so we are working on adding subsetting support for CFF but it's a biggish task and will take a while (several seasons)." I think it can read the font, but that's it really.. no real support yet.

I don’t know about subsetting, but I think converting to WOFF and EOT.

@Michel: yes, I guess I was busy with something else in my head and forget about to either move it to a did in PATH or call it with the full path like ~/ohyes/sfnt2woff
I'm going to try this one, thanks for the tips.

@Ralf H: thanks for the tips, I will check fontsquirrel again. The thing is that by using it I'm not sure what's going on behind the scenes. I don't know that either when I'm calling sfntly (well, I can check the source code), but at the moment I want to try it locally first anyway to see if I can generate the same results.

As for conversion CFF to TTF, it's indeed not my main concern at the moment. But I rather not convert it right away (automatically) to start with the basics first and then compare later. Like, I don't know if anyone seriously compared the fonts after applying Font Squirrel TT hinting automatically (and by self made conversion or whatever)

Hi Rolf,

I've build a webfont generator that converts TTF & OTF files into all usual web-font formats (WOFF, EOT, SVG). It also offers subsetting and auto-hinting if you need this. I called it Fontie, the magic webfont generator.

I also wrote a post about how everything works and what tools I use behind the scenes.

Bai
Torben

PS: Excuse me for linking to my own stuff, but I think this could be of some help here ;) Please tell me if this is not appreciated and I'll remove the links...

PPS: Whoops, I just realized the threads date. So also sorry for reviving an an old thread ;(

Captured from web.archive.org on 3 Aug 2017. view this capture