This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Monday, September 26, 2005

Firefox and MathML on Linux

While it's a little more work compared to Windows, getting MathML to work on Firefox isn't that hard. Now, it's easier than ever thanks to the *.spec files created by Michael A. Peters:

http://mpeters.us/fc_extras/mathematica_ttf.spec
http://mpeters.us/fc_extras/mathtype_ttf.spec

(Copies of the files are also available here)

Before we can start building RPMs as a regular user, we need to install the fedora-rpmdevtools package from the Fedora Extras repo:


[darkknight@darkworld ~]$ sudo yum install fedora-rpmdevtools



Once that's installed, we need to create the directory tree and RPM macros needed by rpmbuild:


[darkknight@darkworld ~]$ fedora-buildrpmtree



Now that we're ready to build RPMs, we download and save the SPEC files under the ~/rpmbuild/SPECS/ tree:


[darkknight@darkworld SPECS]$ wget http://mpeters.us/fc_extras/mathematica_ttf.spec http://mpeters.us/fc_extras/mathtype_ttf.spec



Once we have the spec files, we need to get the sources. We can get them from the URLs specified in the respective spec files:

MathType
Mathematica

(We need the Mathematica 4.1 Fonts)

We need to save the downloaded fonts under ~/rpmbuild/SOURCES/

Next, we need to install the cabextract package to satisfy build requirements:


[darkknight@darkworld ~]$ sudo yum install cabextract



Now, to build the font RPMs, switch to the ~/rpmbuild/SPECS directory and run:


[darkknight@darkworld SPECS]$ rpmbuild -bb mathtype_ttf.spec
[...]

[darkknight@darkworld SPECS]$ rpmbuild -bb mathematica_ttf.spec
[...]


In both cases, the long messeges should end in:


+ exit 0


If not, then you need to hunt down the problem and solve it. Assuming they both ended with the exit status '0', we can go ahead and install our freshly baked RPMs:


[darkknight@darkworld ~]$ sudo yum localinstall ~/rpmbuild/RPMS/noarch/math*



In addition to those packages, we also need the mathml-fonts package:


[darkknight@darkworld ~]$ sudo yum install mathml-fonts



Once we have all the required fonts, we have disble PANGO for firefox. In order to do this, we need to uncomment the following lines from /usr/bin/firefox :

MOZ_DISABLE_PANGO=1
export MOZ_DISABLE_PANGO

One that's done, we're good to go! We can test the new MathML rendering capabilities at:

http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml

0 Comments:

Post a Comment

<< Home