Last Comment Bug 228804 - mathml rendering is worse on MacOS X after adding Mathematica fonts in 1.3b and later
: mathml rendering is worse on MacOS X after adding Mathematica fonts in 1.3b a...
: fixed1.8
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: PowerPC Mac OS X
-- major with 11 votes (vote)
: ---
Assigned To: rbs
: Hixie (not reading bugmail)
: Anthony Jones (:kentuckyfriedtakahe, :k17e)
: 257977 (view as bug list)
Depends on:
Blocks: 161137
  Show dependency treegraph
Reported: 2003-12-17 12:52 PST by Daniel Jamous
Modified: 2007-02-10 11:18 PST (History)
22 users (show)
mtschrep: blocking1.8b5+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

tentative patch (1.14 KB, patch)
2005-09-26 00:39 PDT, rbs
sfraser_bugs: review+
jaas: review+
sfraser_bugs: superreview+
asa: approval1.8b5+
Details | Diff | Splinter Review
rendering with patch and FF build from 9/26/05 (111.79 KB, image/jpeg)
2005-09-26 18:18 PDT, Josh Aas
no flags Details
fix (661 bytes, patch)
2005-09-30 23:08 PDT, rbs
sfraser_bugs: review+
sfraser_bugs: superreview+
mscott: approval1.8b5+
Details | Diff | Splinter Review

Description User image Daniel Jamous 2003-12-17 12:52:08 PST
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030212
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030212

See screenshot at:

on MathML torture test (see URL above), tests 5, 8, 13, 16, 18, 19, 21, and 22
are broken.

This problem has happened in all the Mozilla versions since 1.3 beta.

Reproducible: Always

Steps to Reproduce:
1. get Mozilla version 1.3 beta or any version later
2. go to the MathML torture test at:

Actual Results:  
screenshot at:

Expected Results:  
give a MathML rendering at least as good as the ones obtained with versions 1.3a
and earlier -- see following screenshot with Mozilla 1.3a:

This bug showed up between versions

1.3 alpha and 1.3 beta.
Comment 1 User image rbs 2003-12-18 14:56:38 PST
1.3a was Dec 13 2002, and 1.3b was Feb 10 2003.

Here are the checkins in gfx/src/mac between 1.3a and 1.3b:

Observation: Nothing appears to me as suspicious with respect to math fonts.

Here are the checkins in layout/mathml between 1.3a and 1.3b:

Observation: Nothing appears to me as suspicious with respect to math fonts,
except perhaps bug 191529 -- but this was cross-platform.

Here are all the checkins between 1.3a and 1.3b:

Observation: There is the complete list of checkins... but nothing hits at the
face as the culprit. I wonder however if it isn't an upshot of alecf's "mac/unix
side of fix for bug 188251".

Cc:ing some mac folks build their own debug builds of mozilla. Help to further
narrow the problem will be appreciated.
Comment 2 User image rbs 2003-12-18 14:58:59 PST
> Cc:ing some mac folks build their own debug builds of mozilla.
Comment 3 User image rbs 2004-08-08 20:50:12 PDT
Daniel, is the bug still there with the latest nightly build? I am curious if
the patch for bug 120401 has had any unexpected effect here.
Comment 4 User image Daniel Jamous 2004-08-09 11:58:55 PDT
(In reply to comment #3)
> Daniel, is the bug still there with the latest nightly build? I am curious if
> the patch for bug 120401 has had any unexpected effect here.

Hi Roger, yes the bug is still there unfortunately (both on 1.8a and 1.7.2).
Comment 5 User image Frankie 2005-01-05 20:31:20 PST
*** Bug 257977 has been marked as a duplicate of this bug. ***
Comment 6 User image distler 2005-03-05 23:53:19 PST
Bug is even worse with recent 1.8b2 nightlies. Square-root sign sometimes
completely disappears (in expressions where you have
<msqrt>...<mfrac>...</mfrac>...</msqrt>). Here's a page where you can see both
badly-rendered and disappearing square-root signs:

If I get the chance, I'll prepare a reduction.
Comment 7 User image YAMASHITA Makoto 2005-09-25 17:46:43 PDT
I'm now using Firefox 1.5b.
Comparison of "Contents/MacOS/res/fonts/" between Firefox and Mozilla v1.3a
shows that the file "" is missing in Firefox.
I simply copied that from Mozilla v1.3a. Then my Firefox renders the "Torture
Test" page as fine as Mozilla v1.3a.
Did something go wrong in the "packaging" process?
Comment 8 User image rbs 2005-09-26 00:25:44 PDT
> Did something go wrong in the "packaging" process?

Good catch... I can't believe that all this pain that was placed on MathML Mac
users was due to a poor packaging. It can be very damaging (and elusive too),
indeed. See also bug 228992 on non-Mac platforms.
Comment 9 User image rbs 2005-09-26 00:31:52 PDT
Make that bug 228922 instead.
Comment 10 User image rbs 2005-09-26 00:39:40 PDT
Created attachment 197388 [details] [diff] [review]
tentative patch
Comment 11 User image rbs 2005-09-26 00:54:29 PDT
Mac folks, I hope you guys can realise the *urgency* of this patch and give it a
try (I cannot test it it myself since I don't have a Mac build environment). It
 will be (and has been) ridiculous to miss out on Firefox 1.5 due to a mere
packaging issue.

Also important, watch out in bug 190307 too. I hope such an omission doesn't
come back to bite us ever again in Camino as well.
Comment 12 User image David Harvey 2005-09-26 06:25:29 PDT
I can partially confirm YAMASHITA Makoto's experience.

I installed latest nightly firefox binary (Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:
1.9a1) Gecko/20050925 Firefox/1.6a1), copied the file "" from mozilla 1.2.1 
(the 1.3 alpha binary seemed to be missing?) into the appropriate location, ran the font installer as per, and bingo, the torture test looks much better. e.g. 
square root signs are rendered decently.

However, still some problems: I get a popup message about missing fonts (CMSY10, CMEX10, Symbol), 
and some of the tests don't look great, e.g. #19 and #22 the braces are hugely cropped, all the minus 
signs are missing in #9, generally speaking the italicised lowercase greek letters look weird, and 
sometimes whole rows go missing if I scroll too fast.

I subsequently tried installing the truetype computer modern fonts (copied them into my ~/Library/
Fonts folder), and lots of things got broken... now it only complains that "Symbol" is missing, but all the 
vertical bars are broken (rendered as little boxes) e.g. in #14, #24, and all the spacing is starting to 
look like "HTML equations".

Please excuse me for not having any idea how this whole fonts thing works. I hope this info is helpful.
Comment 13 User image Simon Fraser 2005-09-26 09:20:26 PDT
Looks like bsmedberg broke this.
Comment 14 User image Josh Aas 2005-09-26 18:18:07 PDT
Created attachment 197497 [details]
rendering with patch and FF build from 9/26/05

Here is a jpeg of the mathml torture test on a build of Firefox from 9/26/05
with the "tentative patch" applied. Looks better, but not perfect. See the
black boxes in row 13.
Comment 15 User image rbs 2005-09-26 19:04:20 PDT

Josh, did you install the fonts at ?

This bug was about the worse rendering due to Mathematica fonts. There is a
"sister" bug about the worse rendering due to TeX fonts. That's bug 161137. I am
adding a dependency for ease of cross-link between the two.
Comment 16 User image Josh Aas 2005-09-26 19:33:37 PDT
When I did my test, I had not installed any fonts that did not come with Mac OS X.
Comment 17 User image Josh Aas 2005-09-26 19:35:47 PDT
Looks like this didn't get landed on the branch. rbs - can you do that?
Comment 18 User image rbs 2005-09-26 20:17:37 PDT
Comment on attachment 197388 [details] [diff] [review]
tentative patch

Asking approval for the 1.8 branch.
Comment 19 User image rbs 2005-09-27 17:28:09 PDT
Checked in the 1.8 branch.
Comment 20 User image rbs 2005-09-29 20:24:37 PDT
I got a feedback saying that wasn't copied in the
res/font directory:

"It is in the gfx/src/mac directory (which is where the patched gfxmac.pkg file
is), just the default build command [make -f] doesn't link it to the
dist/ build directory.  That is why I'm assuming I'm building it wrong."

Any helpful clues?
Comment 21 User image YAMASHITA Makoto 2005-09-30 05:44:46 PDT
I can't build Firefox on my own so this may be irrelevant, but
gfx/src/gtk/ and gfx/src/windows/ have lines like
	$(INSTALL) $^ $(DIST)/bin/res/fonts

	$(INSTALL) $^ $(DESTDIR)$(mozappdir)/res/fonts
that gfx/src/mac/ does not have. Corresponding location in
gfx/src/mac/ is around the line 117?
Comment 22 User image Jungshik Shin 2005-09-30 06:32:32 PDT
yeah, that's it. I'll upload a patch
Comment 23 User image rbs 2005-09-30 23:08:36 PDT
Created attachment 198107 [details] [diff] [review]
Comment 24 User image rbs 2005-09-30 23:13:19 PDT
jshin, as I was poking around, I noted that isn't
packaged too on Windows...
Comment 25 User image Jungshik Shin 2005-10-01 00:31:18 PDT
Thanks. I filed bug 310654 for that
Comment 26 User image Scott MacGregor 2005-10-01 11:35:53 PDT
Comment on attachment 198107 [details] [diff] [review]

please get this in ASAP. Thanks.
Comment 27 User image Jungshik Shin 2005-10-01 19:27:04 PDT
landed on the trunk and 1.8 branch
Comment 28 User image Simon Spiegel 2005-10-09 02:44:18 PDT
With Firefox Beta 2 this seems to be working, but I still get the missing fonts (CMSY10, CMEX10, Symbol) 
dialog, which is strange since everything is displayed nicely (from what I can tell). Is this a different bug?
Comment 29 User image rbs 2005-10-19 18:05:06 PDT
> which is strange since everything is displayed nicely

It is not strange because just like the letter "a" can be found in several
fonts, so too can the glyphs from the missing fonts found in the Mathematica
fonts. So, no worries. You are not missing anything (on the Mac). You can get
rid of that dialog with a pref.

The issue is subjective. Since beauty is in the eye of the beholder, some people
_prefer_ (and expect...) the look & feel of TeX fonts. Others prefer Mathematica
fonts. Others Don't Care and want things to Just Work (tm). While those leaving
on the bleeding edge are eagerly awaiting the STIX fonts ( 

Here are screenshots of a same page rendered with different stretchy font
settings. These will give you a precise idea why it is academical/subjective,
but still itchy enough for some people to insist on one or the other, just like
one person might prefer Times while another prefers Verdana. That's life.

Default screenshot (if you have all of the fonts...)

Mathematica screenshot (if you set the pref to use Mathematica fonts...)

TeX screenshot (if you set the pref to use TeX fonts...)

For how to set the pref, see the section "Customize the fonts used for stretchy
characters" at

BTW, there has been a follow-up to fixup the Mac/Mathematica experience and
avoid holes in stretchy characters under certain font sizes. I just fixed that
in bug 311046.

Another BTW. I got a feedback from a happy user asking to pass this message along:

You have made my day! There is now at least one cross-platform web browser that
supports MathML.

Please pass on my thanks for all those involved in resolving the problem [this
bug 228804].

Best wishes,

Ian Ferris
Food and Environmental Protection Section
Joint FAO/IAEA Division of Nuclear Techniques in Food and Agriculture
P.O.Box 100, Wagramer Strasse 5
A-1400 Vienna, Austria, European Union

Comment 30 User image Paul Libbrecht 2005-10-24 05:24:50 PDT
I am fully convinced yet...

I have an issue with the following saved html:

On Linux, it's showing fine on both firefox 1.5-beta-2 and 1.0.2: one indeed sees a case definition.

On MacOSX, it's showing wrong on firefox 1.5-beta-2: the case definition is showing a kind of enormous blank which is covering much of the rest of the text...

I have the following fonts: Math fonts for Mathematica 4.0 (I wanted 4.1 or 4.2 but they are only available as .exe installers and cabextract can't extract them so I am limited to what MIT installer provides, version 4.0).
As well, I have cmex10.ttf, cmmi10.tff, cmr10.ttf, and cmsy10.ttf.

Another glitch I noted is that some round brackets are turned into "implies" and absolute-values are made as white-black-bordered-rectangles.

I could provide screen shots.

Comment 31 User image rbs 2005-10-24 17:47:02 PDT
Just to be sure, try this pref to keep TeX fonts out of the way because they cause problems on the Mac (c.f. bug 161137):

user_pref("font.mathfont-family", "Math1, Math2, Math4");

Also try a latest nightly build that has the fix of bug 311046 (Firefox 1.5b2 suffers from this bug).
Comment 32 User image rbs 2005-10-24 20:18:18 PDT
Even safer (on the Mac). To stay clear of bug 161137, which remains mysterious so far, you might as well not install the TeX fonts at all.

But if you absolutely need them for other Mac applications (such as OzTeX or Textures), you should therefore stop them from messing the MathML by removing the TeX font names from the "font-family" property of the "math" element in mathml.css, in addition to setting the font.mathfont-family pref above... 

The "font-family" CSS declaration is for normal (i.e., non stretchy) situations whereas the font.mathfont-family pref is for stretchy characters. So the big picture here is to exclude TeX fonts from all situations (no re-compilation is involved and so it can be advertised to end-users if it works). Let me know if it works indeed.
Comment 33 User image Paul Libbrecht 2005-10-25 01:38:26 PDT
Well, indeed, the nightly of today fixes the issues that appeared there with the case-definition mtable.

I still see some issues with the brackets being turned into Rightarrow, Leftarrow and the overall impression that the font used in MathML is slightly lower than the font used in the rest of the text. This with or without the line prefs.js.

I'll have to report back on this.


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