Can I convert embedded base64 encode font to a font file?

mauriblint picture mauriblint · Sep 21, 2012 · Viewed 26.7k times · Source

I have an @font-face rule, and its look like this:

@font-face{
    font-family:'F';
src:url("") format("embedded-opentype"),
url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAA ... ETC... ETC

Can i convert this to a font file?

Thanks!

Answer

mcrumley picture mcrumley · Sep 21, 2012

Copy the base64 encoded part and convert it. There are many ways to do that.

Linux

base64 -d base64_encoded_font.txt > font.woff

Mac OS X

openssl base64 -d -in base64_encoded_font.txt -out font.woff

WIndows

Go to http://www.motobit.com/util/base64-decoder-encoder.asp and paste the text. Choose "decode the data from a Base64 string (base64 decoding)" and "export to a binary file".