Morten Hjort
Morten Hjort

Reputation: 1012

WOFF2 conversion from standard WOFF

I've seen that some Google Webfonts now use WOFF 2.0. Can I somehow convert my existing WOFF-fonts to this new (and supposedly better format)? And how?

Upvotes: 24

Views: 19614

Answers (5)

stackprotector
stackprotector

Reputation: 13451

On Ubuntu, you can convert WOFF to OTF/TTF and then to WOFF2:

woff2sfnt myfont.woff > myfont.ttf
woff2_compress myfont.ttf

Package dependencies:

sudo apt install woff-tools woff2

Upvotes: 1

PavlosVos
PavlosVos

Reputation: 212

I managed to convert with https://everythingfonts.com/woff-to-woff2 did it for my fontawseome icons

Upvotes: 5

dors
dors

Reputation: 1152

Certainly! You can convert the existing woff files to the new format. You will get more than 30% improvement on the compression ratio.

Even though browser support is limited at this moment

http://caniuse.com/#feat=woff2

It will eventually change. You should use the @font-face fall back and start putting these kind of directives in your css now.

 @font-face {
   font-family: MyFont;
   src:
       url('font.woff2') format('woff2'),
       url('font.woff') format('woff');
  }

You can use the following tools to convert from ttf/woff to woff2.0

http://everythingfonts.com/woff-to-woff2

https://github.com/google/woff2

Upvotes: 30

Colin Bacon
Colin Bacon

Reputation: 15609

Font Squirrel generator now includes WOFF2 in it's generated fonts. So you can create it that way from your TTF file.

Upvotes: 2

operatino
operatino

Reputation: 92

I could't find any WOFF to WOFF2 converters, but you can easy convert your current WOFF font to TTF with any service like this. And then using this WOFF2 cheat sheet, convert TTF to WOFF2.

I tested those steps with my fonts, converted font WOFF -> TTF -> WOFF2 works fine.

Upvotes: 6

Related Questions