Converting font from WOFF (Web Open Font Format) to a format I can use in MS Word

26

7

I have a WOFF file I downloaded from a website that I want to convert for use in Microsoft Word documents and such. Is there any free way to do this? After much searching I have not found a way, so I am turning to Super User for help.

MESLewis

Posted 2010-09-24T01:08:59.293

Reputation: 611

3If you had included the name of the font (or the url of where you found the WOFF file), we might have been able to find a source for TTF or OTF version that wouldn't need conversion and might include more characters. – Dan D. – 2012-04-29T06:47:41.187

Answers

23

Yes, the WOFF format is a container for the table-based sfnt structure (used by TrueType and OpenType). It adds some meta data to the TTF/OTF font and can also compress the actual font data.

If you want to convert from WOFF to the wrapped TTF/OTF font, you can use the woff2sfnt-tool created by Jonathan Kew at Mozilla. He provides pre-compiled binaries for the sfnt2woff-tool (convert from TTF/OTF to WOFF) for OS X and Windows, but not for the woff2sfnt-tool (convert from WOFF to TTF/OTF), so you have to compile from the source. Easily done if you have a working compiler toolchain — just download the source-zip-file and run make.

When you have a working woff2sfnt binary, you just do:

$ ./woff2sfnt font.woff > font.otf

The resulting font is an ordinary TTF/OTF font that you can use, but please note that if you download a WOFF font from a web site, you are supposed to comply with the license of this font. Licensing information can be included in the WOFF meta data.

Erik Tjernlund

Posted 2010-09-24T01:08:59.293

Reputation: 339

1-1 didn't provide the correct link – Supuhstar – 2014-08-13T22:23:06.330

2Excuse me? The links I provided (over a year ago) still works. I also clearly state you have to compile the tool yourself. Please read before down voting. – Erik Tjernlund – 2014-08-17T21:07:02.787

6For Ubuntu Linux and similar systems, the package containing woff2sfnt and sfnt2woff is called woff-tools – yuvilio – 2014-12-31T20:04:59.593

2link is broken? – oldboy – 2018-08-26T15:43:36.877

The source code seems to be available on github wget/sfnt2woff. There's also google/woff2 for working with the woff2 format. And a python implementation specifically for converting woff to otf hanikesn/woff2otf. And the bramstein/sfnt2woff-zopfli repo mentioned below

– iolsmit – 2019-07-16T11:16:01.320

5woff2sfnt-tool can't find it... – Muhammad Umer – 2013-12-21T02:46:07.763

4

Following Erik Tjernlund's link, I downloaded the source and compiled a i386 executable of woff2sfnt and sfnt2woff for Windows. You can download it from my Dropbox here.

(Note that this works on x86-64 machines as well. In fact, you can't build it for x86-64 because the binary object provided by Jonathan Kew is for the i386 architecture type.)

Paul Lammertsma

Posted 2010-09-24T01:08:59.293

Reputation: 3 508

For those reading with no Cygwin experience, you need cygwin1.dll (from 'cygwin'), cygz.dll (from 'zlib0') and cyggcc_s-1.dll (from 'libgcc1'). Once these are in the same directory it will work fine. – seagull – 2016-04-19T14:57:59.453

cygwin1.dll was not found – Muhammad Umer – 2013-12-21T02:47:03.720

@MuhammadUmer Evidently you need to install Cygwin in order to get it working. – Paul Lammertsma – 2013-12-22T18:05:02.990

2

i got the woff2sfnt source to compile for windows 10 x64 with the following steps cobbled together from other references (i.e. i'm not claiming any original thought here)

  • the mozilla source host appears to be dead, found it here: https://github.com/wget/sfnt2woff... extracted all that to a working folder
  • used http://tdm-gcc.tdragon.net/ as a friendly gcc compiler stack installer
  • added #include <fcntl.h> at the top of woff2sfnt.c under #ifdef WIN32, in addition to io.h already there
  • downloaded the zlib source from http://www.zlib.net/ and copied all its root .c and .h files into my working folder
  • my gcc command line: gcc -o woff2sfnt.exe woff2sfnt.c woff.c compress.c uncompr.c deflate.c inflate.c adler32.c inffast.c crc32.c trees.c zutil.c inftrees.c

i realize this is all very brute force, for i'm a mere C# programmer with the soft underbelly afforded by modern tools, uninitiated with doing gcc the right way.

Beej

Posted 2010-09-24T01:08:59.293

Reputation: 151

2

You can use FontForge to convert it - it is an application that can create and edit font files.

You install it, and then you can right click on the Font file and select 'Properties'. Next to 'Open With' click 'Change', then go to 'Browse': enter image description here

You then need to find the location of the FontForge executable - on Windows 7 64bit it is located here:

C:\Program Files (x86)\FontForge\run_fontforge.exe

Once you have opened the font, you ignore most errors about wrong table types and stuff, and click 'Generate Fonts':

Select the save location, and ttf or otf as the export format. OTF fonts sometimes can have higher quality depending on the font you are importing.

enter image description here

Fontforge can use a variety of export and imported font types, so it can be used to conver other fonts as well. It is also very useful for making or recreating your own fonts. There is a guide here with other uses of FontForge.

enter image description here

Wilf

Posted 2010-09-24T01:08:59.293

Reputation: 221

1

to convert WOFF2 files to ttf on macOS, try

brew install fonttools
ttx font.woff
ttx font.ttx

ttx font.woff will convert your .woff file to a .ttx file (an XML font file format). Then ttx font.ttx will convert the .ttx to a .ttf.

If the file you get out of ttx font.ttx can't be imported you can try dragging font.ttf into Font Book, reading what the errors are (click the drop down arrow next to the font name) and fixing them in the .ttx file. For example, I had to add a namerecord.


For batch conversion try

for f in *.woff; do ttx $f; done
for f in *.ttx; do ttx $f; done

I also tried google's woff2 from this repo

brew tap bramstein/webfonttools
brew install woff2
woff2_decompress font.woff

but that didn't create any .ttf or .otf files.


In the end I googled "fontname otf" and installed that instead.

Boris

Posted 2010-09-24T01:08:59.293

Reputation: 179

0

Roberto

Posted 2010-09-24T01:08:59.293

Reputation: 233

1None of those do batch conversions :/ – Supuhstar – 2014-08-14T02:39:15.407