Bug 118179 - Mozilla's font display of MathML is incorrect
Mozilla's font display of MathML is incorrect
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mozilla (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Gecko Maintainer
Ben Levenson
http://www.w3.org/Math/testsuite/
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-12 15:59 EST by Yue Shi Lai
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 15:29:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to /usr/lib/mozilla-1.4.3/res/mathml.css (506 bytes, patch)
2004-09-13 23:21 EDT, Yue Shi Lai
no flags Details | Diff
Upstream patch for the upstream bug 212400 (794 bytes, patch)
2007-05-30 12:58 EDT, Matěj Cepl
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Mozilla Foundation 212400 None None None Never

  None (edit)
Description Yue Shi Lai 2004-03-12 15:59:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.4) Gecko/20030922

Description of problem:
Mozilla fails to display MathML with correct font, even if the
required MathML fonts are installed (see below).

Version-Release number of selected component (if applicable):
mozilla-1.4-3.0.18

How reproducible:
Always

Steps to Reproduce:
1. Go to http://www.mozilla.org/projects/mathml/fonts/ and install the
TeX and Mathematica fonts required for Mozilla's MathML functionality.
2. Open the W3C's MathML test suite http://www.w3.org/Math/testsuite/
3. 

Actual Results:  The font display is completely messed up, with
(LaTeX's) \in instead of 2, etc.

Expected Results:  Correct MathML rendering in compliance to W3C's
test suite.

Additional info:

The Mozilla-Bug http://bugzilla.mozilla.org/show_bug.cgi?id=212400 is
likely the cause.
Comment 1 Christopher Blizzard 2004-03-12 17:21:41 EST
We'll be releasing a 1.4.2 branch build that should fix this soon.
Comment 2 Yue Shi Lai 2004-09-13 23:21:36 EDT
Created attachment 103811 [details]
Patch to /usr/lib/mozilla-1.4.3/res/mathml.css

With the newest RHEL update, the problem seems to be still there (Mozilla
version 1.4.3). However, as I found a solution, I think reopen this bug is
appropriate.

First some explaination why this behavior is still there:

1. At least on RHEL (because of UTF-8?), it is neccessary for the Latin font to
be in front of Symbol (Greek), otherwise the Greek glyph is preferred over the
Latin one, even for ordinary Latin letters. See also
http://silas.psfc.mit.edu/tth/symfontconfig.html for another reference about
this problem.

2. Times is not available as XFT (TrueType) font, therefore it should be
changed to one that is available (specifically for RHEL: Thorndale and maybe
some people have Times New Roman installed).

My proposed change to mathml.css is included. The resulting rendering is not
100% W3C conform, but should be usable now for anyone who install the proper
fonts.
Comment 3 John E. Koontz 2006-08-09 19:59:25 EDT
It appears that neither the current seamonkey nor the current firefox packages 
(seamonkey-1.0.4-0.5.1.fc5, firefox-1.5.0.6-2.fc5) in FC5 are Xft-enabled.  
The mozilla package (mozilla-1.7.13-1.1.fc5) is.  Part of the solution to 
making MathML possible is to have browsers that can access the True Type fonts 
that support it.  That's much better than having the users try to figure out 
how to find and make accessible any Type 1 Postscript support.  

The other half of the solution appears to be to have the fonts available 
accessible.  It looks like the mathml-fonts package (mathml-fonts-1.0-21.fc5) 
installs its fonts in /usr/share/fonts/mathml, but doesn't integrate them into 
Xft properly per the instructions in, e.g., the Fedora Core 3 or 4 Release 
Notes.  In other words, one needs to run ttmkfdir, mkfontdir, and chkfontpath 
on any suitable font directories.  There may be other font-including 
directories that are missing this apparatus, too.   

Apart from the mathml-fonts fonts, one also needs the Mathematica 4.1 fonts in 
True Type form, and they can't be distributed.  The user has to get them from 
Wolfram.  Maybe some kind of "get and install" tool could be provided.  Or 
maybe Wolfram would be kind enough to distribute the configured files in 
package form?  

Also, one needs a symbol font, and the easiest ways to get this are to link 
the AdobeReader font directory, or the OpenWindows one, into /usr/share/fonts, 
and run the installation scripts on them, too.  I don't suppose the Adobe 
folks would be thrilled to do this, though they do provide their reader in a 
package format.   But, more generally, any True Type font directory in an fc5 
package should perhaps be linked to /usr/share/fonts (or installed there) and 
suitably processed?  

If all these were done, there would be a good chance that eventually MathML 
would work out of the box.  

The general procedure above is suggested at 
http://draal.physics.wisc.edu/Notes/MathML, on the assumption that one has an 
Xft-enabled browser.  
Comment 4 Red Hat Bugzilla 2007-02-05 14:32:06 EST
REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred.
Comment 5 Matěj Cepl 2007-05-15 05:48:31 EDT
Reporter, are you able to reproduce this bug with the latest firefox/seamonkey
package in the latest upgrade of RHEL 3, please?
Comment 6 Christopher Aillon 2007-05-15 13:45:15 EDT
Probably.  I don't believe we ship the right fonts by default.  But downloading
mathematica should help.
Comment 7 Matěj Cepl 2007-05-30 12:58:14 EDT
Created attachment 155709 [details]
Upstream patch for the upstream bug 212400
Comment 8 Matěj Cepl 2007-05-30 21:19:11 EDT
Concerning fonts -- we have in Extras mathml-fonts package, which is not perfect
(still missing tons of glyphs from Wolfram's Mathematica), but it allows me to
got to 27xx on Mozilla character testing
(http://www.mozilla.org/projects/mathml/fonts/chars/table.html). Would it be
that much difficult to push at least mathml-fonts package into standard spin of
Fedora/RHEL?

Concerning the W3C testing suite itself, I was able to get through General/Math
types and only on General/GenAttribs/attribQuote1 Mozilla complained about
missing fonts with proper dialog and with information about where to get proper
fonts.

Using firefox-1.5.0.10-6.fc6

So, my conclusion is that this should be fixable with newer versions of a
gecko-based browser.
Comment 9 John E. Koontz 2007-05-31 15:29:58 EDT
My original comments to mcelrath relative to his valuable instructions on how 
to get MathML working.   His steps - what fonts to collect and install and 
running ttmkfdir, mkfontdir, and chgfontpath have to be followed exactly to 
get a TrueType solution to work.  I never found a working PostScript 
solution.  All the instructions were for different Linux setups than the 
current Red Hat-Fedora one.  

Date: Wed, 09 Aug 2006 18:51:20 -0600
To: bob+indexhtml@mcelrath.org
From: John Koontz <koontz@boulder.nist.gov>
Subject: MathML Wiki Page

I'm very grateful for http://draal.physics.wisc.edu/Notes/MathML, which along 
with the Fedora Core 4 Release Notes helped me get SeaMonkey and Firefox 
browsing MathML in Fedora Core 5, where the instructions at 
http://www.mozilla.org/projects/mathml/fonts/ did not.   Thanks!

Addenda for Fedora Core 5 (FC5)

Comment 1 did not seem to apply to Fedora Core 5 (FC5).  However, the FC5 
package versions of SeaMonkey (c. 1.0.2) and Firefox (c. 1.6) seem to be Xft-
disabled.  [no longer true] Mozilla (legacy package) is Xft-enabled. [now part 
of seamonkey, and broken seamonkey has been fixed]  To get Xft-enabled 
versions of the first two (capable of processing True Type fonts), go to 
mozilla.org and download the tarballs from there.   

Re. 2.1.1, in Fedora (FC5) you can get the MathML fonts in the mathml-fonts 
package.  They have not been processed with ttmkfdir, mkfontdir, and 
chgfontpath, however, and you will have to do that per the instructions in the 
FC4 (but not FC5) release notes at http://fedora.redhat.com/docs/release-
notes/fc4 (search for Xft).  

Re. 2.2, if you have AdobeReader_enu-7.0.8-1 installed, 

cd /usr/share/fonts
ln -s  /usr/local/Adobe/Acrobat7.0/Resource/Font/ adobe

If you have openoffice.org-core installed, 

cd /usr/share/fonts
ln -s  /usr/lib/openoffice.org2.0/share/fonts/truetype openoffice

Or maybe 

ln -s  /usr/lib/openoffice.org2.0/share/fonts openoffice

would be more kosher, though I'm not sure how that affects the running of 
ttmkfdir, etc.  

Re. 4, not necessary in Fedora (FC5), but you do have to run the ttmkfdir, 
etc., scripts in each directory you appropriate (/usr/share/fonts/mathml), 
create (/usr/share/fonts/mathematica) or link in (/usr/share/fonts/adobe or 
openoffice).  

If you install the object code tarballs for firefox or seamonkey they are best 
put in /usr/local/appname-appvers where they will not conflict with the 
existing packages in /usr/bin, /usr/lib, etc.  For ease of management, make 
symbolic links from /usr/local/appname to /usr/local/appname-appvers and 
from /usr/local/bin/appname to /usr/local/appname/appname, where appname and 
appvers are seamonkey or firefox and their current versions.   This eases 
changing versions.  You'll want /usr/local/bin before /usr/bin in your paths.  
You can rename /usr/local/bin/appname to appname.off or link it 
to /usr/bin/appname if needed.  

Better Wolfram font source:

http://support.wolfram.com/mathematica/systems/unix/general/manualfontdownload.
html

In more detail the process is:

Part II:  Beautifully (or more beautifully)

To get a nicer version - no idea if it is up to snuff with the picky - you 
need nicer fonts.  Here is how you get them.  For now the quick version.  This 
is based on 

http://72.14.203.104/search?
q=cache:3jGDIsz_tZAJ:draal.physics.wisc.edu/Notes/MathML+fedora+mozilla+mathml+
ttf&hl=en&gl=us&ct=clnk&cd=5

which starts all too accurately


Getting MathML working on linux is a bitch, despite the fact that MathML 
support is compiled into Mozilla versions 1.4 and higer. The problem is in 
getting Mozilla to find the required fonts. Here are the basic requirements:

A less adequate version with the wrong commands is at 
http://www.mozilla.org/projects/mathml/fonts/.

Get the TTF versions of the Mathematica 4.1 fonts and put them 
in /usr/share/fonts/mathematica.   (Not later versions - 4.1 is what you want.)
Make sure the mathml-fonts package is installed, in which case they are 
in /usr/share/fonts/mathml.  
Put a links in for the AdobeAcrobat and/or OpenOffice symbol fonts:

[107] > ls -l openoffice adobe
lrwxrwxrwx 1 root root 42 Aug  8 19:28 adobe -
> /usr/local/Adobe/Acrobat7.0/Resource/Font/
lrwxrwxrwx 1 root root 47 Aug  8 19:30 openoffice -
> /usr/lib/openoffice.org2.0/share/fonts/truetype

Might be more conventional to link above the truetype level in the latter 
case.    You only really need one of these.  OpenOffice is probably installed, 
but you only have the Acrobat fonts if you went to the Adobe site and got the 
AdobeReader (not Acrobat anymore) package and installed it.  

Make sure that the Microsoft symbol font (symbol.ttf) is not installed.   (It 
wasn't in my case.)

In regard to each of the directories above run

Create the /usr/share/fonts/local/ directory (if it doesn't already exist): 

mkdir /usr/share/fonts/local/

Copy the new font file into /usr/share/fonts/local/ 
Update the font information by issuing the following commands (note that, due 
to formatting restrictions, the following commands may appear on more than one 
line; in use, each command should be entered on a single line): 

ttmkfdir -d /usr/share/fonts/local/ -o /usr/share/fonts/local/fonts.scale


mkfontdir /usr/share/fonts/local/

If you had to create /usr/share/fonts/local/, you must then add it to the X 
font server (xfs) path: 

chkfontpath --add /usr/share/fonts/local/

Substitute the actual directory, e.g., mathml, for local.  

(Per http://fedora.redhat.com/docs/release-notes/fc4/)

Note that "fontpath" here is what you otherwise manipulate with xset fp (see 
man page), but this is better and permanent.    (I don't think xset is 
permanent.)  

This is pretty much it.   

===

The required fonts are MathML + Mathematica 4.1 + a Symbol font.  

The main thing that is difficult is providing the Mathematica 4.1 True Type 
fonts.  Wolfram does not seem to provide a suitable distribution on these, 
though they do distribute them with a fair degree of freedom.  Perhaps they 
could be persuaded to do so, or perhaps an equivalent that is sutably 
distributed can be found.  

Their policies are stated at

http://support.wolfram.com/mathematica/systems/windows/general/latestfonts.html
(referred from http://www.mozilla.org/projects/mathml/fonts/)

For some reason they provide the files in an easy format for Windows and Macs, 
but not for Linux.  They require you to come to this site.  This precludes a 
*.rpm in general circulation.   

As far as alternatives, see http://www.stixfonts.org/.  Very close.  


Comment 10 RHEL Product and Program Management 2007-10-19 15:29:01 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Note You need to log in before you can comment on or make changes to this bug.