
-----------------------------------
Homer_simpson
Wed Aug 13, 2003 1:09 pm

Java script useful function
-----------------------------------
I got this function from a tutorial it seems pretty useful so i post it here: 

function checkIfInstalled(fname){
   loaded = document.readyState == "complete";
   teststr = "font&nbsp;existence&nbsp;test"
   if(!window.fntLyr0) {
      lyrstr0 = ""+ teststr +"";
      lyrstr1 = ""+ teststr +"";
      if (loaded) {
         document.body.insertAdjacentHTML("BeforeEnd",lyrstr0);      
         document.body.insertAdjacentHTML("BeforeEnd",lyrstr1);
      }
      else {
         document.write(lyrstr0);
         document.write(lyrstr1);
      }
   }
   fntLyr1.style.fontFamily = fname +",Courier";
   width0 = (isMac) ? fntLyr0.offsetWidth : fntLyr0.scrollWidth;
   width1 = (isMac) ? fntLyr1.offsetWidth : fntLyr1.scrollWidth;
   return (width0 != width1);
}

fname is the font name that yer checking to see if installed... then function reutrns a boolean to show whether it's installed or not...
