W3C home > Mailing lists > Public > www-style@w3.org > January 2009

Re: @font-face support detectable in Javascript?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 07 Jan 2009 08:30:36 -0500
Message-ID: <4964AE7C.6090901@mit.edu>
To: Dave Crossland <dave@lab6.com>
CC: "www-style@w3.org" <www-style@w3.org>, Ed Trager <ed.trager@gmail.com>

Dave Crossland wrote:
> 2009/1/7 Ed Trager <ed.trager@gmail.com>:
>> If someone on this list has any ideas on how to check for @font-face
>> support using Javascript, please let all of us know about it.

You could try using the CSSOM to see how the browser parsed the 
@font-face rule.  It's clunky, and you'd need to check for various 
conditions (e.g. UNKNOWN_RULE in some UAs vs the rule being absent from 
the CSSOM altogether in others), and some UAs may not support the 
relevant parts of the CSSOM.  But it would have the advantage of working 
today with no further browser changes.

It might not be a bad idea to introduce a feature string or something 
for this, though....

Received on Wednesday, 7 January 2009 13:31:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:23 UTC