Version 2 runs on the Prototype 1.6.1 library w/ SwfObject 2.1.
The Scalable Inman Flash Replacement (sIFR) library (here) is great for introducing new typefaces into web content.
I ported the code to work with prototype and swfobject, trimming the code and adding features along the way.
Following is code showing how to replace a given css selector with flash font text.
var oIfr = new Ifr();
if(oIfr.isSupported) {
oIfr.apply('#Container h1', {
'src': 'fonts/Font.FranklinGothic.swf',
'wmode': 'transparent'
});
}
One limitation I saw with the original sIFR was that colors were hard coded. I changed this to look into the CSS itself for color information. Browsers handle colors a little differently so I ported code over from Stoyan Stefanov's color library (here) as well.
My scripts requires the following standard javascript imports to be made.
- prototype/prototype.js
- model/swfobject.js
- model/ifr.js (this is the prototype-based IFR library)
- behavior/ifr.js (this is the prototype-based IFR library)
View a sample Prototype Inman Flash Replacement application here
Download the sample code here
You will still need to generate fonts in the way described by the original sIFR library (here).