[jQuery] Re: How to check for specified fonts
Yes. That certainly would have been an issue if I were doing the testing on an XHTML 1.1 page. In fact, however, I'm doing it on a kind of "gateway" page that gives access to more than one distance-learning courses, only one of which (a Calculus course) needs the full MathML capability. So I serve the gateway page and all the non-Calculus course pages as XHTML 1.0 Transitional. If someone using IE6 or IE7 then wants to access the Calculus course, I additionally check for the presence of DesignScience's free MathPlayer plugin (http://www.dessci.com/en/products/mathplayer/). When running this plugin on IE it has the effect of overwriting the DOCTYPE of the XHTML 1.1 pages, making their content available as text/ html. Ed Martin
[jQuery] Re: How to check for specified fonts
I wonder if it has anything to do with the fact that you must serve XHTML 1.1 as real XML instead of using the text/html mime type, which I assume you are doing if you have it working in IE as it does not support XHTML served in the correct way. That's an absolute stab in the dark, and probably nothing to do with it in fact, but I thought it might be worth considering. Good luck getting to the bottom of it. Joel Birch.
[jQuery] Re: How to check for specified fonts
Well, you're right that it works for the usual fonts. I hadn't noticed that because my interest in having such a test derives from the desire to detect if users have the necessary fonts installed to display MathML in documents served as http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd";> So I'm testing for the presence of the Mathematica 4.1 fonts (Math1, Math2, etc) and the CM fonts (cmsy10, cmr10, etc). The span-width test works fine on Internet Explorer 6 and 7, but not on Firefox. In fact, on Firefox 2.0.0.7 (with its built-in MathML capability), those fonts appear to have been hijacked out of the public realm. I can't assign any of them via CSS and have things display as expected on Firefox. For example, Beginning middle end displays on Firefox using the default paragraph font. I'd never noticed that before. So I guess this is out of the jQuery domain now. I'll have to investigate what's going on with Firefox and the MathML fonts. Thanks for your assistance, though. Ed Martin On Oct 6, 11:21 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote: > I set up a test and added some debugging code and it works for me. > Here is the relevant stuff so you can see how it differs. > > HTML: > > Some well-chosen sample text > Some well-chosen sample text > > > JS: > function IsItThere( fontname ){ > $("#test").css("font-family", fontname + ", monospace" ); > var testWidth = $("#test").width(); > var ctrlWidth = $("#ctrl").width(); > console.log('testWidth: '+testWidth); > console.log('testWidth: '+ctrlWidth); > return ( testWidth != ctrlWidth );} > > $(function(){ > $(document).click(function() { > IsItThere('Arial'); > }); > > }); > > I made is so you click the page anywhere and the width values are > displayed in the Firebug console. > > Joel Birch.
[jQuery] Re: How to check for specified fonts
I set up a test and added some debugging code and it works for me. Here is the relevant stuff so you can see how it differs. HTML: Some well-chosen sample text Some well-chosen sample text JS: function IsItThere( fontname ){ $("#test").css("font-family", fontname + ", monospace" ); var testWidth = $("#test").width(); var ctrlWidth = $("#ctrl").width(); console.log('testWidth: '+testWidth); console.log('testWidth: '+ctrlWidth); return ( testWidth != ctrlWidth ); } $(function(){ $(document).click(function() { IsItThere('Arial'); }); }); I made is so you click the page anywhere and the width values are displayed in the Firebug console. Joel Birch.