Pango-enabled firefox breaks MathML support

Bug #19066 reported by José Aliste
42
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Medium
Fedora
Won't Fix
Medium
firefox (Ubuntu)
Fix Released
Medium
Mozilla Bugs

Bug Description

The Mathml rendering in the Ubuntu package of Firefox is awful. I just tried the
installer from mozilla.org and the rendering is Ok. I have installed all the
corresponding fonts.

Revision history for this message
In , Joao (joao-redhat-bugs) wrote :

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Description of problem:
Install the recommended fonts for MathML (http://www.mozilla.org/projects/mathml/fonts/)

Compare display with firefox 1.0.1 installed as suggested in
http://fedoranews.org/tchung/firefox

Version-Release number of selected component (if applicable):
firefox-1.0.1-1.3.1, firefox-1.0.1-1.3.2

How reproducible:
Always

Steps to Reproduce:
1. Install the recommended fonts for MathML (http://www.mozilla.org/projects/mathml/fonts/)
2. Access http://www.mozilla.org/projects/mathml/demo/texvsmml.xhtml or some other MathML test page

Actual Results: Alignement all wrong

Expected Results: Compare display with firefox 1.0.1 installed as suggested in
http://fedoranews.org/tchung/firefox

Additional info:

Local fonts for MathML include
Acrobat Reader PS fonts
Mathematica 4.1 tt
LaTeX fonts

This font set works for Mozilla and other Firefox releases. Additional details if requested.

Revision history for this message
In , Joao (joao-redhat-bugs) wrote :

Now it is also present on mozilla-1.7.6-1.3.2 under FC3

It is _not_ present in
http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.6/contrib/mozilla-i686-pc-linux-gnu-1.7.6-gtk2+xft.tar.gz

So it seems to be introduced by Fedora packaging

Revision history for this message
In , Joao (joao-redhat-bugs) wrote :

I have changed severity to high as this potentially messes up any MathML site
accessed from Fedora.

Screenshots are available at

the good:
http://www.math.ist.utl.pt/~jmatos/CapturaEcra-13.png

the ugly (the latest mozilla-1.7.6-1.3.2):
http://www.math.ist.utl.pt/~jmatos/CapturaEcra-14.png

Revision history for this message
In , Matt (matt-redhat-bugs) wrote :

This seems to be due to Pango, as is assumed do to the timing, since it was
enabled default around the beginning of March. If you run:

> MOZ_DISABLE_PANGO=1 firefox

you can view all the MathML sites correctly (albeit with that annoying Symbol
dialog, i.e., #133709). A ye olde post here:

http://mail.gnome.org/archives/gtk-i18n-list/2003-February/msg00042.html

seems to say that Pango and MathML (Mango?) don't play nicely. Another out
there says that Blizzard was working on a corrolary to this problem:

http://lists.gnu.org/archive/html/lilypond-devel/2004-05/msg00084.html

So, I guess you can't have both worlds right now. I suppose a "Disable Pango if
you want to read math" statement is needed in rather BOLD letters at Moz/Firefox
Fedora pages/release notes.

Revision history for this message
In , Joao (joao-redhat-bugs) wrote :

(In reply to comment #3)
>
> So, I guess you can't have both worlds right now. I suppose a "Disable Pango if
> you want to read math" statement is needed in rather BOLD letters at Moz/Firefox
> Fedora pages/release notes.

This is an update to a release (FC3) for which MathML support existed so release
notes wouldn't make much sense. Breaking upstream features in an update does not
seem a good policy anyway...

From the point of view someone writing MathML pages this situation is a total
mess. It would be acceptable, but a pain, if one could detect from "Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Fedora/1.7.6-1.3.2" that
"This Mozilla MathML rendering has been broken for the sake of pango by your
Linux distribution. Get a copy from mozilla.org". Come on: one can do something
similar with IE with or without MathPlayer but not with Mozilla/Firefox with or
without MathML support?!

If the maintainer ever reads please consider (from the SPEC file I gather it was
not intentional):
-- reinstating MathML support in an update for FC3;
-- making lack of MathML support for FC4 or FC5 and later detectable by dynamic
pages;

or get pango vs. MathML fixed!

Revision history for this message
In , Warren (warren-redhat-bugs) wrote :

*** Bug 150398 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Warren (warren-redhat-bugs) wrote :

ouch...

Revision history for this message
In , Christopher (christopher-redhat-bugs) wrote :

Blizzard!

Revision history for this message
José Aliste (jose-aliste) wrote :

Created an attachment (id=3021)
Screenshot of rendering with the mozilla.org firefox(1.0.5)

Revision history for this message
José Aliste (jose-aliste) wrote :

Created an attachment (id=3022)
Screenshot of rendering with the mozilla-firefox package from Ubuntu

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Appears to be (kinda) fixed in recent firefox errata, as it seems to enable
pango for only Indic locales.

Revision history for this message
In , Warren (warren-redhat-bugs) wrote :

Not sure what you are seeing, but according to caillon this hasn't changed. You
are either using the RHEL builds or built by someone else. In any case
disabling pango is not an option for future Fedora, this and other pango firefox
bugs must eventually be fixed.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Sorry Warren, you're right, I'm on RHEL4. I guess I kinda assumed (my bad) that
the FC and RHEL builds were the same (or similar) in this respect.

Revision history for this message
David Farning (dfarning) wrote :

Tested under breezy
firefox 1.0.7-0ubuntu20
i686

This seems to be an upstream issue. have you read the following bug
report at https://bugzilla.mozilla.org/show_bug.cgi?id=128153#c81

I was unable to test the installation instructions because the MT Extra TTF
fonts are wrapped in a windows only installer.

-dtf

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

*** Bug 23075 has been marked as a duplicate of this bug. ***

Revision history for this message
David Farning (dfarning) wrote :

*** Bug 24611 has been marked as a duplicate of this bug. ***

Revision history for this message
Dennis Schaaf (dennis-schaaf) wrote :

This seems to be because of Fonts not installed by default. I get the following
error message:

"To properly display the MathML on this page you need to install the following
fonts:

Math1, Math2, Math4, Symbol.

For further information see:

http://www.mozilla.org/projects/mathml/fonts"

Revision history for this message
Dr. Stefan Schimanski (sttts) wrote :

A short time fix comes from here:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150393

Disable Pango in the firefox start script by commenting out:

  MOZ_DISABLE_PANGO=1
  export MOZ_DISABLE_PANGO

Voila, it works again.

Changed in firefox:
status: Unconfirmed → Confirmed
Revision history for this message
In , Matt (matt-redhat-bugs) wrote :

Folks, I recently upgraded my FC4 box to Firefox 1.5. This is the Tummy.com
rebuild for FC4 and for whatever reason, the problem seems to be fixed. I don't
want to change the status until I have FC5 running, but maybe a FC5beta/Rawhide
runner can check this?

Of course, Bug 133709 is *still* unresolved. I really, really get annoyed by
that Symbol dialog.

Revision history for this message
In , JP (jp-redhat-bugs) wrote :

The problem will only be solved if indic locales and mathml coexist. The
previous poster should check the status of the PANGO lines in (presumably)
/usr/bin/firefox and give a URL for the tummy.com SRPM.

Revision history for this message
In , Matt (matt-redhat-bugs) wrote :

Welp, you're right. The RPM was built off the instructions here:

https://www.redhat.com/archives/fedora-devel-list/2005-November/msg01244.html

and what do they say to do: remove the Pango/Cairo bits. Aw nuts, I was hoping
all was well. Oh well, I guess I'm on the other side of the Mango mess now,
good math, bad languages. And, of course, it works with some sites that just go
nuts with Fx 1.07 (Iron Sudoku, say).

Revision history for this message
Constantine Evans (cevans) wrote :

I can confirm that this is due to Pango. Searching around, this seems to be a somewhat well known problem that is not easy to fix.

We do need to replace the error message, however. That error is given even when the fonts ARE installed, making users think that the problem is with the installation of the fonts in latex-xft-fonts. When pango is disabled, the fonts load properly.

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!

Revision history for this message
In , JP (jp-redhat-bugs) wrote :

The bug is present in FC5. It is not a security issue. I seem to be unable to
change fc3 -> fc5 although I was the original poster.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

retargetting fc5.

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Ok, assigning to myself.

There are two issues here:

  1) very wrong spacing
  2) math font is not selected

attaching a patch for the first, with before/after shots.

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 133599
Torture test before

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 133600
Torture test after

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 133601
Spacing patch

After figuring out what's going on, the patch was quite obvious and simple...

Revision history for this message
In , Matthias (matthias-redhat-bugs) wrote :

Nice patch! Just remove the printfs

Revision history for this message
In , Christopher (christopher-redhat-bugs) wrote :

They're commented out, but if you think they are useful enough, feel free to
wrap them all in #ifdef MOZ_DEBUG_PANGO and be sure to #undef MOZ_DEBUG_PANGO at
the start of the file.

Revision history for this message
In , Matthias (matthias-redhat-bugs) wrote :

Ah, I had overlooked the comments around the first one

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 133665
new patch

A *much* nicer patch to the same effect. Poor Pango defines all these macros
and functions that firefox doesn't use...

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 134685
committed patch

This is the patch that should hit rawhide pretty soon.

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Compared to the previous patch, the on in comment 25 uses logical width instead
of ink width. That's the expected behavior. It also has a little optimization,
dropping an strlen.

The rest of the MathML was not working simply because Pango was refusing to
choose font/shaper for Private Use characters. That was a one-line fix. With
that, it only was not rendering the THIN SPACE character. That's this bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=145275

I also worked around it by making Pango choose font/shaper for space characters
too. All this is in Pango 1.14.1 that is in Rawhide already.

With these, I get Pango render the MathML Torture Test exactly like the Xft
backend. I even changed Pango to use a fixed 96 dpi resolution and got an image
that had only 14 pixel differences with the Xft one, and those are minimal
antialiasing differencing for the letter Pi. (Attaching all in a minute)

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 134687
Torture test Xft rendering

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Created attachment 134688
Torture test with the patch and Pango 1.4.2, at 96dpi

Revision history for this message
In , Mozilla-behdad (mozilla-behdad) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Epiphany/2.14
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Epiphany/2.14

Attaching a patch that fixes MathML rendering under Pango. This has been tracked downstream here:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=mathml

For more details, check that bug.

Reproducible: Always

Revision history for this message
In , Mozilla-behdad (mozilla-behdad) wrote :

Created attachment 235101
The patch

It's very short and rather trivial.

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Ok, filed a few bugs upstream.

Attaching the pango-mathml patch:
https://bugzilla.mozilla.org/show_bug.cgi?id=349904

The no-pangoxft patch that I added to devel:
https://bugzilla.mozilla.org/show_bug.cgi?id=349906

The jagged brackets you see in the screenshots (not specific to Pango):
https://bugzilla.mozilla.org/show_bug.cgi?id=349907

Revision history for this message
In , Rbs (rbs) wrote :

Comment on attachment 235101
The patch

If jshin is happy with it, so will I be.

Revision history for this message
In , Jshin1987 (jshin1987) wrote :

Comment on attachment 235101
The patch

r=jshin

Now I wonder if we should consider switching to pagno for FF2 (perhaps, it's too late in the cycle). In addition, I forgot uploading my patch for bug 327946 made a long time ago.....

Revision history for this message
In , Rbs (rbs) wrote :

Comment on attachment 235101
The patch

sr=rbs, I am going to check this in.

Revision history for this message
In , Rbs (rbs) wrote :

Checked in.

Revision history for this message
In , Shaver (shaver) wrote :

Comment on attachment 235101
The patch

I want this on the branch to keep Linux distributors from having to take it themselves. Doesn't affect code we ship, and it remedies a significant problem with the pango builds of the 1.5.x era.

Revision history for this message
In , Beltzner (beltzner) wrote :

Comment on attachment 235101
The patch

a=beltzner on behalf of the 181drivers

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

Remove "Pango breaks MathML" from about.xhtml
https://bugzilla.mozilla.org/show_bug.cgi?id=350266

Revision history for this message
In , Rbs (rbs) wrote :

Created attachment 240109
patch sync'ed to the 1.8 branch

Revision history for this message
In , Rbs (rbs) wrote :

Checked in the 1.8 branch.

Revision history for this message
In , Rbs (rbs) wrote :

Behdad, it seems pango is still suffering -- see bug 321994.

Ian Jackson (ijackson)
Changed in firefox:
assignee: ijackson → nobody
Revision history for this message
In , Twalker (twalker) wrote :

verified with Linux BE nightly from 20061009

Changed in firefox:
status: Unknown → Fix Released
David Farning (dfarning)
Changed in firefox:
assignee: nobody → mozillabugs
Revision history for this message
anonym (launch-mailinator) wrote :

from the firefox mathml page:

To stop Mozilla from popping up the missing font dialog about TeX fonts, just set this pref in your prefs.js (or your user.js):

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

Revision history for this message
Alexander Sack (asac) wrote :

mozilla bug 128153 was not the right one ... updating remote bug info for this.

BTW, this should be fixed in firefox 2.0.0.x. Can anyone with edgy/feisty confirm that this is gone?

Revision history for this message
Freddy Martinez (freddymartinez9) wrote :

Can someone provide a link to test this on? My system is feisty + Fx 2.0.0.1

Revision history for this message
Constantine Evans (cevans) wrote :

Freddy, just go to any site that uses mathml - search for mathml, for example - and make sure that pango rendering in firefox is enabled. If I recall correctly, pango is only used for firefox rendering now if there are certain language support packages installed which need the enhanced language support - in other words, the bug hasn't been fixed, but it won't show up for most users now.

Changed in firefox:
status: Unknown → Fix Released
Revision history for this message
Ilmari Vacklin (wolverian) wrote :

The Symbol thing is pretty ugly - can't we alias it so that Gecko recognizes Standard Symbols L?

See http://kb.mozillazine.org/Gecko:_FAQs_:_Linux_XFT_and_MathML#Installing_the_Symbol_font for the ugliness.

David Farning (dfarning)
Changed in firefox:
assignee: mozillateam → mozilla-bugs
Revision history for this message
George Pollard (porges) wrote :

I’m still getting pretty bad results even on Gutsy (2.0.0.3). Maybe I haven’t got all the right fonts installed, but this should be something that works out-of-the-box.

Revision history for this message
George Pollard (porges) wrote :

Installing latex-xft-fonts only makes matters worse.

Revision history for this message
George Pollard (porges) wrote :

And to show it’s still a Pango issue, here’s a screenshot with MOZ_DISABLE_PANGO

Revision history for this message
Alexander Sack (asac) wrote :

this is fixed for firefox > 2.0

Changed in firefox:
status: Confirmed → Fix Released
Revision history for this message
Kevin Goldstein (parktownprawn) wrote :

I'm running Firefox 2.0.0.4 and I only get decent MathML support with pango disabled.

My version of firefox is:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)

Revision history for this message
In , Matěj (matj-redhat-bugs) wrote :

Fedora Core 5 is no longer supported, could you please reproduce this with the
updated version of the currently supported distribution (Fedora Core 6, or
Fedora 7, or Rawhide)? If this issue turns out to still be reproducible, please
let us know in this bug report. If after a month's time we have not heard back
from you, we will have to close this bug as CANTFIX.

Setting status to NEEDINFO, and awaiting information from the reporter.

Thanks in advance.

Revision history for this message
In , Behdad (behdad-redhat-bugs) wrote :

This is fixed in FC6 and F7.

Revision history for this message
Fibonacci (fibonacci-prower) wrote :

> this is fixed for firefox > 2.0
Only with Pango disabled, apparently - or better yet, not compiled in.
I'm running Firefox 2.0.0.6 and have the following fonts installed: Math1, Math2, Math3, Math4, Math5 (from Mathematica 4.1), cmex10, cmmi10, cmr10, cmsy10 (from TeX), and Symbol.
While the MathML "torture tests" from http://www.w3.org/Math/testsuite/ look great with Pango disabled, all kinds of strange glyphs appear instead of the expected rendering otherwise.
I also have to point out that, when none of the aforementioned fonts is installed, MathML looks the same with or without Pango - and while it's not as good as the sample renderings, it certanly looks much better than with both Pango and fonts.

Changed in firefox:
importance: Unknown → Medium
Changed in fedora:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.