#1 Bug in noImageFonts plugin

v3.4
closed-accepted
nobody
5
2007-04-26
2007-04-25
Jetsada
No

For jsMath 3.4a, in the file noImageFonts.js:

jsMath.Font.extra_message =
'Extra TeX fonts not found: <b><span id="jsMath_ExtraFonts"></span></b><br/>'
+ 'Using unicode fonts instead. This may be slow and might not print well.<br/>\n'
+ 'Use the jsMath control panel to get additional information.',

The last comma cause syntax error in javascript. It should replace with ";".

Another problem is it still require to load def.js at jsMath/fonts/xxx/def.js
If that file isn't exist, jsMath will skip processing the remaining TeX.

Discussion

  • Davide P. Cervone

    Logged In: YES
    user_id=1161141
    Originator: NO

    Thanks for posting your bug report using the SourceForge site! You are the first one, and I'm hoping others will follow your example.

    The comma versus semicolon is clearly an error. Don't know how that slipped by. Apparently some browsers are less finicky than others. I will fix the file and include it in the next release.

    As for the jsMath/fonts/xxx/def.js issue, that is not an error. You do need to have that file, but you don't need all the image files. That is, you can remove the "alpha" and "plain" directories from the jsMath/fonts/xxx/ directory. The .def file includes all the information about the font, and in particular, the size of the various characters, and so on. jsMath can't work with the font without this, so you will need to have it installed on your server if you intend to use the extra font. Only that one file is needed, however, not the images (when you are using the noImageFonts plugin). I will need to update the documentation for that to make it clearer.

    It is probably not a good idea to use extra fonts with noImageFonts plugin, as most extra fonts do not include the information needed to work in unicode mode. If the user doesn't have the actual TeX fonts installed (which is very likely the case), then the results will generally be garbage in unicode mode. The exception is msam10 and msbm10, the two AMS fonts, which have Unicode mappings included in them. Some of the others have an attempt at mapping them to unicode, but the unicode mode is not very reliable.

    Davide

     
  • Davide P. Cervone

    • status: open --> pending-accepted
     
  • Davide P. Cervone

    Logged In: YES
    user_id=1161141
    Originator: NO

    PS. I will look, into the fact that the rest of the page is not processed. This may also be browser dependent. In some cases, jsMath will be waiting for the file to download, and will eventually time out, but it is a fairly long wait (two minutes or so, as I recall), so the rest might be handled after that occurs. I'll check into it and see if there is a better approach, but putting the file in place is the real solution.

    Davide

     
  • Davide P. Cervone

    • status: pending-accepted --> closed-accepted
     
  • Davide P. Cervone

    Logged In: YES
    user_id=1161141
    Originator: NO

    OK, I found the problem that caused jsMath to stop processing the page (in some browsers) when an autoloaded extension (like a font file) is not found on the server. I will include a fix in the next release. I have attached a patch that you can use in the meantime. You need to load it BEFORE you load jsMath.js. When you install this, jsMath should process the rest of the page (but not the equation that loads the missing file, or any equations that use the features that file was supposed to define).

    Hope this takes care of the problem for you.

    Davide
    File Added: patch-2007-04-25.js

     
  • Davide P. Cervone

    Fixes error when external file can't be loaded

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks