Search code examples
fontsfont-facetypeconverter

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


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!


Solution

  • 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".