jsMath issue and solution with error code -7

53 views
Skip to first unread message

Philippe Saade

unread,
Aug 24, 2008, 10:46:13 AM8/24/08
to sage-s...@googlegroups.com
Hi,

i post this here for future newbies who might encounter the same problem...

** on Linux/Ubuntu 8.04, under Firefox 2 or 3, with all TexFonts
installed, i kept having this error message :

It looks like jsMath failed to set up properly (error code -7)

for a single
sage : show(x^2)

command.

My solution was to :

* mkdir -p /home/foobar/.fonts (for user foobar)
* download on of the zip file here :
http://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.html
(the TeX-fonts-15.zip looks not too dark.)
* unzip the .zip
* restart firefox
* (adjust scale size in the options of jsMaths control panel to suit my taste)

Philippe

Timothy Clemans

unread,
Aug 24, 2008, 1:20:27 PM8/24/08
to sage-s...@googlegroups.com
I've been seeing this with the last few releases.

mitch_feaster

unread,
Sep 2, 2008, 7:51:13 PM9/2/08
to sage-support
Thanks a lot! Worked perfectly for me.

Doug Bradshaw

unread,
Oct 10, 2008, 4:45:47 PM10/10/08
to sage-support
Thanks!

Jason Grout

unread,
Oct 10, 2008, 4:55:23 PM10/10/08
to sage-s...@googlegroups.com


We really ought to include these fonts with Sage and have the error
message say: "Here are some fonts. Install them. If you want darker or
lighter variations, go here (link to the website)"

Jason

mabshoff

unread,
Oct 10, 2008, 4:55:56 PM10/10/08
to sage-support


On Oct 10, 1:55 pm, Jason Grout <jason-s...@creativetrax.com> wrote:

<SNIP>

> We really ought to include these fonts with Sage and have the error
> message say: "Here are some fonts.  Install them.  If you want darker or
> lighter variations, go here (link to the website)"

#1608 :)

> Jason

Cheers,

Michael

dpvc

unread,
Dec 1, 2008, 8:22:51 AM12/1/08
to sage-support
The real problem is not the missing fonts, but the fact that sage
doesn't include the jsMath image fonts that are supposed to be used
when the jsMath TeX fonts aren't available. I'm sure this was not
included because it was considered to be too large a component, but it
really should be, as it would have avoided this problem that so many
of you are having. On the other hand, if you choose not to install
the image fonts, there is a noImageFonts plugin that should be used so
that jsMath knows about the fact that you don't have the image fonts,
and will not try to use them when they aren't there (which is what is
causing the warning message). If sage uses the jsMath/easy/load.js
file (and I don't whether it does or not), then there is a
"noImageFonts" setting that should be changed to 1 if you don't have
the image fonts. That will cause the noImageFonts plugin to be loaded
at the proper time. The best solution is to install the image fonts
available from

http://sourceforge.net/project/showfiles.php?group_id=172663

but if you don't want to do that, then using the noImageFonts plugin
is the next best thing.

Davide

Jason Grout

unread,
Dec 1, 2008, 11:17:34 AM12/1/08
to sage-s...@googlegroups.com


Thanks for your reply, Davide. We have an optional sage package for the
image fonts that is easy to install. You're right, we decided to not
make it standard because of the size.


Currently, if the jsmath image fonts are not installed, we add the
following code to the header of the page:

<script type="text/javascript"
src="/javascript/jsmath/plugins/noImageFonts.js"></script>


and then later, we have:

<script src="/javascript/jsmath/jsMath.js" type="text/javascript">

Should the order of these lines be reversed? I'm pretty sure we don't
use the easy/load.js (and I'm not sure why).


Thanks,

Jason


For references on the optional spkg, see the discussion from

http://groups.google.com/group/sage-support/browse_thread/thread/e186e7ce4f7253c5/2822d7e064b5bad2?lnk=gst&q=1971#2822d7e064b5bad2

or the trac ticket at

http://trac.sagemath.org/sage_trac/ticket/1971

Pierre

unread,
Dec 2, 2008, 5:05:01 AM12/2/08
to sage-support
are you able to select "native tex fonts" in the jsmaths preferences ?
i can only use "unicode fonts", they look okay but they're not the
usual Tex fonts, that's for sure.
> http://groups.google.com/group/sage-support/browse_thread/thread/e186...

dpvc

unread,
Dec 2, 2008, 9:55:17 AM12/2/08
to sage-support
> We have an optional sage package for the
> image fonts that is easy to install.  You're right, we decided to not
> make it standard because of the size.

OK, sounds good.

> Currently, if the jsmath image fonts are not installed, we add the
> following code to the header of the page:
>
> <script type="text/javascript"
> src="/javascript/jsmath/plugins/noImageFonts.js"></script>
>
> and then later, we have:
>
> <script src="/javascript/jsmath/jsMath.js" type="text/javascript">
>
> Should the order of these lines be reversed?

Yes, that looks correct. I'm not sure why people are getting the
error -7 under these conditions. It means that something has gone
wrong when trying to load the fallback method, and that usually means
it can't read the image font definition files. There are a couple of
other possibilities as well: perhaps the noImageFonts plugin was not
able to be read (permission issue?) or the unicode fallback file could
not be read. Given your use of noImageFonts, I suspect it may be the
latter. If the users who are getting error -7 are using Firefox3,
that may well be it. There were changes to the same-origin security
policy in Firefox3 that prevent jsMath from loading local files from
directories other than the one in which the HTML file is found. I
worked around this in jsMath v3.6 (released Sept. 2008), so those
users should update to the latest version of jsMath to avoid that
problem.

> I'm pretty sure we don't use the easy/load.js (and I'm not sure why).

Probably because it didn't exist when jsMath support was added to
sage. The easy/load.js file was a relatively late addition to jsMath,
but certainly makes things easier for people. You might consider
whether you want to use that instead.

> For references on the optional spkg, see the discussion from
>
> http://groups.google.com/group/sage-support/browse_thread/thread/e186...

Thanks, I was part of that discussion. :-)

Davide

mabshoff

unread,
Dec 2, 2008, 10:33:49 AM12/2/08
to sage-support


On Dec 2, 6:55 am, dpvc <d...@union.edu> wrote:

<SNIP>

Hi Davide,

> > I'm pretty sure we don't use the easy/load.js (and I'm not sure why).
>
> Probably because it didn't exist when jsMath support was added to
> sage.  The easy/load.js file was a relatively late addition to jsMath,
> but certainly makes things easier for people.  You might consider
> whether you want to use that instead.

For the record: I have made this #4674.

> > For references on the optional spkg, see the discussion from
>
> >http://groups.google.com/group/sage-support/browse_thread/thread/e186...
>
> Thanks, I was part of that discussion.  :-)
>
> Davide

Cheers,

Michael

Pierre

unread,
Dec 2, 2008, 1:19:01 PM12/2/08
to sage-support
Here's a solution to my problem -- I'm pretty sure it could be useful
to other people. Trying to follow the instructions above, I
misinterpreted "unzip the .zip here" (i *always* get these things
wrong).

the way i understood it, i ended up with files like /home/
foobar/.fonts/cmr10.ttf. However, one must keep the folder that's
created when you unzip the archive ! so you really need files such as

/home/foobar/.fonts/Tex-fonts-15/cmr10.ttf

Now it works...


On Dec 2, 4:33 pm, mabshoff <Michael.Absh...@mathematik.uni-
Reply all
Reply to author
Forward
0 new messages