sIFR - Why Bother

One of the problems with setting up how a web page looks is that the browser can only display the page content in a font that is actually installed on the local computer using just the facilities of CSS that are supported by all the commonly used browsers. There have been several different proprietary solutions to embedding fonts into a web page but each of those only works in the browser that defined that solution and using any of those solutions runs the risk of breaking the page completely in other browsers.

The main cross browser solution to this problem that uses current technology is called sIFR. sIFR involves using a combination of JavaScript and Flash to substitute text in a specific font dynamically into a web page regardless of whether the computer displaying the web page has the font available or not.

This solution has several problems of its own though and while it might work for all the major browsers, it will not work for everyone including a percentage of those using browsers where it can work.

The first issue is that this solution uses two technologies neither of which is enabled in all browsers. JavaScript is generally available in almost all browsers but is sometimes disabled. Figures that I have seen suggest that around six to ten percent of browsers do not have JavaScript enabled. This means that your sIFR text is not going to be seen by those six to ten percent of your visitors who will instead see the original text in the page in whatever is the first font that you have defined in the CSS for that content that they have available on their computer.

Flash is a plugin and therefore doesn't come automatically installed in the browser - you have to actually decide to install it if you want it. Adobe claim that Flash is installed on 98% of desktop computers. That claim may be accurate but does not mean much in so far as the percentage of those actually running flash in their browser is concerned. To start with there are all the devices other than desktop computers on which web browsers can be run for which no figure on the percentage that have Flash installed has been provided (or at least I haven't found it anywhere). Then there are all the people who have Flash installed on their computer but who have become so annoyed at all the stupid effects that people who don't know how to write Flash properly have created that they have Flash turned off. Many of these people will have Flash permanently disabled and will even have forgotten that they once installed it (some may even have uninstalled it). Some browsers provide a way that you can have Flash installed where the browser can use it but where the Flash is actually blocked on each page until the browser owner gives permission for a specific Flash to be run. This option gives the most flexibility for Flash because it means that you get to ignore all the garbage and incidental Flash completely and only download and view the Flash that you specifically want to see. I haven't seen any statistics on any of these aspects to what Flash doesn't run (capturing something meaningful in the way of statistics for this would be jst about impossible). Let's be generous and assume that 60% of browsers actually have Flash installed and enabled and we'll also assume that the six to ten percent who don't have JavaScript enabled are also in the 40% who don't have Flash permanently enabled. The figure is probably a lot lower than 60% but the exact figure doesn't affect anything.

So we have 60% of our visitors for whom the sIFR will run and replace the text in our page with the Flash version. Those people will see the text using the font that we selected as the reason why we decided to use the script in the first place. We also have 10% for whom the JavaScript will not run at all and who therefore will see the original text in the page using a font available on their computer. The question is what will the remaining 30% see. Presumably for those who don't have Flash installed they will see the same thing as those without JavaScript see. As for those who have Flash installed but have blocked it the answer as to what they see becomes a big unknown because it all depends on how the browser blocks the Flash from running. If it makes it look to the script as if Flash isn't installed then they will see the HTML content and will not have the option of deciding to enable that specific Flash in order to see it in your selected font. If the script detects that Flash is installed and the block just stops the Flash from running then they will not see either the original or replacement content, all they will see is that there is some Flash in the page which has been blocked. They will have the option to enable the specific Flash but will probably have no reason to do so and will therefore not see that part of your content at all which may render the whole page meaningless (depending on what text you have applied the sIFR to).

As with the proprietary font embedding methods, this method runs the risk of breaking your web page for at least some of your potential visitors.

The other consideration that I haven't mentioned so far is the separation of purpose between the different languages associated with a web page. The purpose of the HTML is to provide semantic markup of your page content. The purpose of CSS is to define the appearance of that content for different media types. The purpose of JavaScript is to define how the page should behave in response to actions by the visitor. By using sIFR we are using the wrong language to define how our page should look.

Oh, and if after all that you decide to still go ahead and use sIFR you should at least make sure you are using the latest version of the code.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate