JQuery plugin for testing font availiability


Tagged

Howard Rauscher has made a handy JQuery plugin script for testing users’ browser for a particular font support.

The basic idea is:

  1. Create an empty span
  2. Insert characters (a-z) into the span
  3. Apply a fake font to the span style
  4. Measure the span width, say, W1
  5. Apply the testing font to the span style (by doing element.css(’font-family’, testFontName);)
  6. Measure the span element width again, say, W2
  7. Compare W1 and W2 to see if they are the same. If yes, the testing font is not available (since applying testing font makes no difference than applying a fake font); otherwise the testing font is available

You can find the original post here:
fontAvailable: Test to see if a font is available

1 comment

RSS / trackback

respond

  1. oli

    on March 18, 2009 at 11:11 pm

    e… I didn’t know that you have your own website. From the look of the address… do u own ur own domain??