This is a quick and dirty process for converting otf fonts to TTF fonts, then converting those TTF fonts into M$-compatible eot fonts.
NOTE This process has only been tested to work in osx, using macports.
- FontForge CLI
port install fontforge
- ttf2eot
port install ttf2eot
- rename
port install rename
- An otf to ttf script for font forge (see below)
Save this as otf2ttf.sh, or something.
#!/usr/local/bin/fontforge
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
SetFontNames($1:r,$1:r,$1:r);
Generate($1:r + ".ttf");
Quit(0);
First, open a terminal and cd
into the font directory.
Second, run this:
for i in *.otf; do fontforge -script ~/Desktop/otf2ttf.sh $i; done
First, open a terminal and cd
into the font directory where the ttfs are found.
Second, run this:
for i in *.ttf; do ttf2eot < $i > $i.eot; done; rename 's/\.ttf//' *.eot
@font-face {
font-family: 'MyFontnormal';
src: url('MyFont-webfont.eot');
src: url('MyFont-webfont.eot?#iefix') format('embedded-opentype'),
url('MyFont-webfont.woff') format('woff'),
url('MyFont-webfont.ttf') format('truetype'),
url('MyFont-webfont.svg#MyFontnormal') format('svg');
font-weight: normal;
font-style: normal;
}