[thelist] Font embedding

kris burford kris at midtempo.net
Fri Jan 2 05:41:17 CST 2004


>So what exactly is the deal with font embedding on websites? It was a hot
>topic around 3 years ago (all tutorials [1] and demos [2] seem to date from
>around then), but since then appears to have fizzled out. But given that it
>is possible, why is no-one doing it? Are the main problems technical, legal,
>or something else?

hi francois,

we did this on a corporate site a couple of years ago (subsequently 
redesigned). from what i can remember we had major issues to get it to work 
across browsers (and it still wasn't perfect).

first we had to define a fontdef, then call an external javascript function 
that would identify the browser and insert the appropriate font call.

something like... (please remember that this is oldish markup and things 
may have moved on. however, we found that *both* formats had to be 
incorporated for things to work. oh, and it was a complete headache!)

<LINK REL=fontdef src="/embeddedfont.pfr">

<SCRIPT SRC="/embeddedfont.js" TYPE="text/javascript">
</SCRIPT>



// contents of embeddedfont.js
if (navigator.appName == "Microsoft Internet Explorer" && 
navigator.appVersion.substring(0,1) >= 4){
          if (navigator.appVersion.indexOf("Windows", 0) != -1){
                 document.writeln("<object");
                 document.writeln("classid=\"clsid:0246ECA8-996F-11D1-BE2F-0 
document.writeln("classid=\"clsid:0246ECA8-996F-11D1-BE2F-00A0C9037DFE\"");
                 document.writeln("codebase=\"http://stage2.bitstream.com/wf 
document.writeln("codebase=\"http://stage2.bitstream.com/wfplayer/tdserver.c 
ab#version=1,0,0,12\"");
                 document.writeln("id=\"TDS\" width=0 height=0");
                 document.writeln(">");
                 document.writeln("</object>");
                 }
         else {
                 document.writeln('<STYLE TYPE="text/css">');
                 document.writeln('@font-face{font-family:embeddedfont;font- 
document.writeln('@font-face{font-family:embeddedfont;font-style:normal;font 
-weight:normal;src:url(/embeddedfont.eot);}');
                 document.writeln('</STYLE>');
                 }
         }





More information about the thelist mailing list