Re: [OpenFontLibrary] font face firefox friendly?

2009-01-07 Thread Aaron Spaulding
On Wed, 2009-01-07 at 16:46 -0500, Liam R E Quin wrote:
> On Wed, 2009-01-07 at 16:37 -0500, Aaron Spaulding wrote:
> > On Wed, 2009-01-07 at 07:31 -0500, Ed Trager wrote:
> > > 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.
> > 
> > Well the definition for the 'em' unit is the size of of the capital
> > letter M in the current font
> 
> No. An em quad is (was) a square of type the size of the type -- the
> full height of the other slugs and as wide as it was tall.

Dang it, should of double checked that first. ex would be the one. :P
-- 
Aaron

http://sachimp.com
http://getcorkd.com


signature.asc
Description: This is a digitally signed message part


Re: [OpenFontLibrary] font face firefox friendly?

2009-01-07 Thread Liam R E Quin
On Wed, 2009-01-07 at 16:37 -0500, Aaron Spaulding wrote:
> On Wed, 2009-01-07 at 07:31 -0500, Ed Trager wrote:
> > 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.
> 
> Well the definition for the 'em' unit is the size of of the capital
> letter M in the current font

No. An em quad is (was) a square of type the size of the type -- the
full height of the other slugs and as wide as it was tall.  It happens
that in many fonts this is close to or the same as the width of the M,
and that gave rise to the name, but they are not guaranteed to be the
same.

>   So, it would be possible to create a font
> with a letter 'M' that has an absurdly large height.  Then you link the
> font to the page, and create a div with a height of 1em.  The pixel size
> of the div should match the the height of the absurdly large
> 'M' (provided you use the right font height).

Interesting idea...

Better to use ex, the x-height, which seems more
likely to be  font-specific, although I didn't check the
CSS spec for it.

Best,


Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org



Re: [OpenFontLibrary] font face firefox friendly?

2009-01-07 Thread Aaron Spaulding
On Wed, 2009-01-07 at 07:31 -0500, Ed Trager wrote:
> 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.

Well the definition for the 'em' unit is the size of of the capital
letter M in the current font.  So, it would be possible to create a font
with a letter 'M' that has an absurdly large height.  Then you link the
font to the page, and create a div with a height of 1em.  The pixel size
of the div should match the the height of the absurdly large
'M' (provided you use the right font height).

Not a perfect solution, but its better than nothing.
-- 
Aaron

http://sachimp.com
http://getcorkd.com


signature.asc
Description: This is a digitally signed message part


Re: [OpenFontLibrary] font face firefox friendly?

2009-01-07 Thread Ed Trager
Hi, everyone,

It would be nice if there were a way to query the browser (using
Javascript) about whether web fonts are supported or not.  If that
were possible, then a web site like the new OFLB site could
dynamically show the web font preview when supported, and hide it from
view when not supported.

The Javascript would be trivial to write but my investigation so far
has not revealed any way of detecting web font support.

It is a common "best practice" principle when coding in Javascript
nowadays to check for the existence of certain properties.  If the
property exists, then we can exploit the functionality whose presence
is implied by the presence of that property.  If not, we can code
around it.

So perhaps we need to encourage the browser developers to expose a
public property, or document such if it already exists:

   if( thisBrowser.supportsWebFonts ){
 myWebFontDiv.style.display="block";
   }else{
 myWebFontDiv.style.display="none";
   }

While I agree that the new OFLB site needs to rally toward the future,
unfortunately it looks clunky to say "The text to the right should be
rendered in Font_ thanks to web font linking with @font-face. If
you see a monospace font, your web browser probably does not yet
support this new web technology."

On my laptop, I see DejaVu Mono Sans used in FF 3.0.5 for the
unsupported @font-face preview.  The problem is, unless I look very
closely, I might actually think that I *have* got a preview of
"Font_xxx" --especially if "Font_xxx" is some kind of sans serif font
(like Puritan, for example)!

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.

- Ed Trager


On Tue, Jan 6, 2009 at 4:00 PM, Dave Crossland  wrote:
>
> 2009/1/6  :
> >
> >>Dave Crossland wrote:
> >>FF3.1
> >
> > So...you are focusing quite a bit of the new site on a feature not present
> > in MSIE, and only present in a beta version of Firefox. Hopefully
> > more browsers will support this in the future
>
> MSIE has web fonts for its DRM format, which the W3C has rejected, so
> no one else will ever support it. So we have to just wait for IE to
> support non-DRM formats.
>
> Opera's latest beta has support. Safari ships with support for nearly
> a year. Chrome is rumoured to have support.
>
> Web fonts is coming.