Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting base64 font back to ttf or otf

Tags:

base64

fonts

I've followed the instructions below but I've not been able to successfully convert to .woff

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

my font file starts with

@font-face {
font-family: "ff_0f65bfd4c8d788fc278265526a59";
src: url(data:font/woff;base64,d09GRk9UVE8AAGQDAAs............

and ends with

...........PPvfkLBXJFlQ==);
}

I can only assume the issue is the portion of the code I'm trying to convert. Any help would be much appreciated.

When I attempt the command below, it just creates an empty file.

openssl base64 -d -in base64_encoded_font.txt -out font.woff
like image 343
Jeremy P. Beasley Avatar asked Jan 23 '14 02:01

Jeremy P. Beasley


2 Answers

Yes you can by using two online tools.

First copy the base64 data, so everything after 'base64,' and leave out the ); ending. Then go this website and paste the code:

http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/

It will download a .bin file. Next go to:

https://onlinefontconverter.com

Upload your .bin file on the right and select convert to otf or tiff from the links on the left. Click the new download link. Download, unzip and your font will be in there!

like image 66
Kupe Avatar answered Oct 12 '22 16:10

Kupe


You can simply open the font from Network panel in developers tools and save it.

Here is step-by-step for Google Chrome:

  1. Open Chrome dev. tools (CMD+SHIFT+I, CTRL+SHIFT+I)
  2. Open "Network" tab, refresh website
  3. Filter only: Fonts
  4. Right click on font file + "Open in new tab"
  5. Save file + name it based on font type.

That's all.

like image 30
usrbowe Avatar answered Oct 12 '22 16:10

usrbowe