Text rendered incorrectly in presence of ligatures and justified text

Bug #37828 reported by James Henstridge
194
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Won't Fix
Medium
firefox (Debian)
Fix Released
Unknown
firefox (Ubuntu)
Won't Fix
Medium
Unassigned
Declined for Gutsy by Henrik Nilsen Omma
firefox-3.0 (Ubuntu)
Fix Released
Undecided
Unassigned
Declined for Gutsy by Henrik Nilsen Omma
ttf-dejavu (Ubuntu)
Fix Released
Undecided
Unassigned
Declined for Gutsy by Henrik Nilsen Omma

Bug Description

For these tests, I am using fairly recent Dapper, containing the following:

  firefox 1.5.dfsg+1.5.0.1-1ubuntu10
  libgtk2.0-0 2.8.16-1ubuntu1
  libpango1.0-0 1.12.0-0ubuntu1

When rendering text on web pages, if a ligature is encountered (e.g. "ff", "fi", "ffi", etc) the ligature glyph gets rendered as expected but the advance of only the first character is used. This results in the characters after the ligature being drawn over the top of the ligature.

If I select text such that the selection begins or ends in the middle of the ligature, the spacing is corrected (since the ligature isn't used). This problem seems to be restricted to Firefox -- other GTK/Pango apps don't exhibit these problems.

Revision history for this message
In , Karl Hegbloom (karl.hegbloom) wrote :

Created attachment 216243
Showing the 'fi' ligature.

Revision history for this message
In , Karl Hegbloom (karl.hegbloom) wrote :

Created attachment 216244
Showing the 'fl' ligature.

Revision history for this message
In , Bugzilla-tecnocode (bugzilla-tecnocode) wrote :

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9a1) Gecko/20060325 Firefox/1.6a1 - Build ID: 0000000000
Works for me with Dejavu Sans.
What font-size have you set it to, and does anything change if you press Ctrl+0? (That's a zero.)

Revision history for this message
James Henstridge (jamesh) wrote : Text rendered incorrectly in presence of ligatures

For these tests, I am using fairly recent Dapper, containing the following:

  firefox 1.5.dfsg+1.5.0.1-1ubuntu10
  libgtk2.0-0 2.8.16-1ubuntu1
  libpango1.0-0 1.12.0-0ubuntu1

When rendering text on web pages, if a ligature is encountered (e.g. "ff", "fi", "ffi", etc) the ligature glyph gets rendered as expected but the advance of only the first character is used. This results in the characters after the ligature being drawn over the top of the ligature.

If I select text such that the selection begins or ends in the middle of the ligature, the spacing is corrected (since the ligature isn't used). This problem seems to be restricted to Firefox -- other GTK/Pango apps don't exhibit these problems.

Revision history for this message
James Henstridge (jamesh) wrote : An example of bad rendering of ligatures

The attachment shows a paragraph from http://blogs.gnome.org/jamesh with different text selections.

The page requests the "sans serif" font, which corresponds to "DejaVu Sans" on Dapper.

Revision history for this message
Chris Ball (chris-ubuntu) wrote : Screenshot showing mis-rendered 'fi'.

I've also been seeing this on dapper HEAD for the last week or two.

Revision history for this message
James Henstridge (jamesh) wrote : Re: Text rendered incorrectly in presence of ligatures

Further information:

The page in question also uses the "text-align: justify" CSS rule. With normal left text alignment, I don't see the rendering problems.

Revision history for this message
James Henstridge (jamesh) wrote :

I didn't notice the bug when searching previously, but bug 36324 is most likely same problem. I'm not sure which direction you'd like to mark them duplicates (that bug is older, but this one probably gets a bit closer to the cause).

Revision history for this message
In , James Henstridge (jamesh) wrote :

I reported this in Launchpad (the Ubuntu bug tracker) here:
    https://launchpad.net/distros/ubuntu/+source/firefox/+bug/37828

The conditions necessary to trigger it are:
 * using Pango for font rendering (the default with the Ubuntu Dapper packages).
 * using a font with ligatures (e.g. DejaVu Sans -- the default sans-serif
   font for Ubuntu Dapper).
 * using "text-align: justify" or equivalent markup to get justified text.

It seems that the ligature glyph is drawn, but the advance of standard glyph for the first character is used, resulting in later characters being rendered over the top of the ligature.

I am not sure if this is an Ubuntu-only bug yet. It would be interesting to hear if people not using Ubuntu are able to reproduce the bug, when the above conditions are met.

Revision history for this message
Jordi Mallach (jordi) wrote :

I think we'll need to revert the fontconfig changes of two weeks ago, or find out if the new DejaVu fixes. Michael?

Revision history for this message
Jordi Mallach (jordi) wrote :

A close look at DejaVu's website reveals version 2.4.1 should fix.

Revision history for this message
James Henstridge (jamesh) wrote :

I tried the 2.4.1 release of "DejaVu Sans" with no change.

I doubt this is caused by a particular font, since:
 * Left aligned text displays correctly in firefox.
 * GTK Applications other than Firefox appear to have no trouble displaying ligatures.

This seems to point at Firefox's Pango rendering code.

Revision history for this message
wouter bolsterlee (wbolster) wrote :
Revision history for this message
James Henstridge (jamesh) wrote :

Some more information:

1. the bug occurs with the FreeSans and FreeSerif fonts too. If this is a font bug, then it is one common to all these fonts.

2. The bug is not present with MOZ_DISABLE_PANGO=1, but it also doesn't use the available ligatures then. This isn't that interesting since the non-pango renderer breaks layout for other languages.

3. I got Ray Strode (from Red Hat) to test if the bug occurred with the Fedora firefox builds, and it turns out that they also exhibit the bug. I also got confirmation of the bug on various other platforms in the comments here:
    http://blogs.gnome.org/view/jamesh/2006/04/03/0

So this doesn't look like an Ubuntu specific bug.

I did up a simple example page that demonstrates the bug here:
    http://www.gnome.org/~jamesh/firefox-ligature.html

Revision history for this message
Zak B. Elep (zakame) wrote :

I can confirm this; I have been seeing this bug since Dapper Flight 4, but it has never interefered with my workflow since, so I haven't paid much attention to this minor annoyance.

Revision history for this message
James Henstridge (jamesh) wrote :

I talked a bit with Christopher Blizzard about the problem on IRC (#gnome-hackers):

 <halfline> jamesh: he says that when firefox does justification it goes into a "draw slow string" code path where firefox passes in it's own spacing
 <halfline> and that there are some known bugs with that layouting engine with generating the spacing
 <halfline> he says he can get on irc and talk to you about it...
 <halfline> let me tell him to get on #gnome-hackers
 --> blizzard (~blizzard@216-15-114-104.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com) has joined #gnome-hackers
 <blizzard> hello
 <jamesh> hi blizzard
 <blizzard> I'm here for a few mins :)
 <halfline> blizzard: url is here http://www.gnome.org/~jamesh/firefox-ligature.html
 <halfline> you'll only see the bug, though, if you have a font that supports ligatures for fi, ffi, etc
 <jamesh> ^^ that page asks for DejaVu Sans specifically (a font that triggers the rendering bug)
 <blizzard> jamesh: so
 <blizzard> jamesh: there's per-character code in the layout engine that does per-character spacing
 <blizzard> jamesh: and that tends to fall apart when you start using justification or letter spacing with any code that does character combinging
 <blizzard> combining
 <jamesh> I guessed something like that given the limited conditions when it gets triggered
 <blizzard> yeah
 <blizzard> if you stay away from those things
 <blizzard> selection and friends should work pretty well
 <blizzard> I fixed parts of the layout engine to support grapheme clusters a long time ago
 <blizzard> but not in all case
 <blizzard> cases
 <jamesh> blizzard: I guess part of the problem is that our default sans serif font now contains ligatures ...
 <blizzard> just the common ones
 <blizzard> ugh
 <jamesh> so a web page using text-align: justify and sans-serif font will trigger it
 <blizzard> that is teh suck
 <blizzard> sounds like it's time to try and get that bug fixed
 <jamesh> if it is difficult to fix, maybe going back to Vera as default would be advisable for Dapper
 <blizzard> could be, could be
 <halfline> i wonder if it would be easier to just tell pango to ignore the ligatures
 <blizzard> ok, food time
 <blizzard> back in a bit
 <jamesh> blizzard: thanks

Revision history for this message
Robin Munn (rmunn) wrote :

I believe bug 33503 is also the same bug.

Revision history for this message
In , Robin Munn (rmunn) wrote :

Based on the comments at James Henstrige's blog post, http://blogs.gnome.org/view/jamesh/2006/04/03/0, it seems his question has been answered. People are seeing this on Debian (both in Firefox and Epiphany), OS X, FreeBSD, Mandriva, Gentoo... Looks like it's not distro-specific.

Revision history for this message
Simos Xenitellis  (simosx) wrote : Comparison between Firefox/Dapper and Deer Park

In Deer Park (experimental version of Firefox) there appears to be no problem with ligatures and DejaVu.

Tested on Dapper, Flight6.

Revision history for this message
In , Vincent+moz (vincent+moz) wrote :

I also see this on Debian with the recent builds (which use pango). Could this bug be confirmed and the subject changed to:

'fi' and 'fl' ligatures too close to following letter in justified text when Pango is enabled

Revision history for this message
calimarno (calimarno) wrote :

I'm having the same problem with Firefox 1.5.dfsg+1.5.0.1-1ubuntu10 running under Dapper.

Revision history for this message
In , James Henstridge (jamesh) wrote :

As Vincent says, this bug is not an Ubuntu only bug. It is just easier to hit on Ubuntu Dapper than other systems.

The prerequisites are:
 1. A Firefox build with pango enabled.
 2. Pango 1.12, which is the first version to use OpenType tables for
    rendering latin text.
 3. A font that contains OpenType ligature table entries, such as DejaVu (the
    Bitstream Vera fonts contain some ligature glyphs but not the associated
    OpenType tables that trigger their use by Pango).

The bug will then present itself on pages where the following hold:
 1. The page requests one of the affected fonts (if an affected font is the
    default serif or sans serif font, then this can be quite common).
 2. The page must trigger the slow manual glyph placement code path, which
    is used in the presence of non-default character or word spacing. The
    "text-align: justify" CSS rule is one way to do this.

The bug has been observed with Firefox 1.5.0.1. In the Launchpad bug, one person posted a screenshot showing that Firefox 1.6a1 did not seem to be affected by the bug. I have not verified this personally though.

Revision history for this message
In , Bugzilla-dolphinling (bugzilla-dolphinling) wrote :

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

Revision history for this message
Simos Xenitellis  (simosx) wrote :

DejaVu 2.5 has just been released,
http://dejavu.sourceforge.net/
which includes a workaround to fix the ligature/justified issue.

I verified that with Dapper Flight 6 (+all updates), DejaVu 2.5 can show http://www.gnome.org/~jamesh/firefox-ligature.html
without any problem.

Revision history for this message
Stefan (stfn2) wrote :

It seems that all the DejaVu people did is make the fi, ff etc. ligatures discretionary in version 2.5, which is not the way to go. These ligatures are, where available, mandatory for Latin-script typefaces. Discretionary is for fancy stuff like ct, st etc. ligatures.

Simos: What does James’s test page look like with the new DejaVu 2.5 fonts? Are the letter combinations in question not ligated at all (as I fear)?

Revision history for this message
Simos Xenitellis  (simosx) wrote :

Stefan: I do not have access to the Dapper box at the moment so I cannot add a screenshot.

Revision history for this message
Miguel Rodríguez (migrax) wrote : Dejavu 2.5 under dapper

It looks like firefox under dapper is not using ligatures with dejavu 2.5.

Revision history for this message
Stefan (stfn2) wrote :

See, that’s what I meant. But since this is a Firefox bug, not a font bug, the change in DejaVu actually deprives us of our test case. So now we need to find another font with standard fi ff etc. ligatures to test this with.

The Junicode font (package ttf-junicode) is one such font. Unfortunately, I cannot test this myself since I am running Breezy on my only computer.

Revision history for this message
Stefan (stfn2) wrote :

Confirmed by several people in the discussion below. Severity is major because it results in illegible text with all sorts of accessibility, security etc. implications.

Changed in firefox:
status: Unconfirmed → Confirmed
Revision history for this message
Stefan (stfn2) wrote :

I prepared two new sample pages (based on James) that use the Bitstream Vera Sans and Junicode fonts:

http://students.washington.edu/baums/tmp/firefox-ligature-2.html
http://students.washington.edu/baums/tmp/firefox-ligature-3.html

(In the case of Bitstream Vera Sans, only the fi and fl ligatures are available, so that table has only two rows.)

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

I don't recommend using the existing Pango code. It's a hack started by Red Hat. It should really not be enabled by distributions except for locales where it's really needed (mostly Indic users).

Revision history for this message
In , James Henstridge (jamesh) wrote :

Surely the Pango code is needed to correctly display the affected languages/scripts in any locale. That'd be why the distributions choose to use the Pango build instead.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

For languages without complex script requirements, the non-Pango code is quite adequate. This includes European languages, most East Asian languages (CJK), and Hebrew. As far as I know, only Indic languages and Arabic (including Persian/Farsi) really benefit from the Pango path.

We are now working on full Pango integration but this won't be ready for quite some time.

Revision history for this message
James Henstridge (jamesh) wrote :

Stefan: note that the bug does not occur with Bitstream Vera Sans. It is not enough for the font to contain the ligature glyphs (which Vera does) -- it must include the appropriate OpenType tables telling the text renderer to use those ligatures in the appropriate places.

I haven't checked the Junicode font, so can't comment there.

Revision history for this message
Stefan (stfn2) wrote :

I thought it did. Open Vera.ttf in Fontforge, go to View -> Show ATT, look at OpenType Tables -> GSUB -> latn -> dflt -> liga, and there is

fi <= f i
fl <= f l

If it doesn’t trigger the bug, then I don’t know why.

Revision history for this message
James Henstridge (jamesh) wrote :

I was using the the otfdump utility from libotf-bin. It doesn't show any "liga" table entries for the copy of Vera.ttf on my system. It is possible that the font would contain ligature table entries if you opened and saved it with fontforge though.

Revision history for this message
Stefan (stfn2) wrote :

Okay, I see., sorry about the confusion. Anyway, I just wanted to point out that DejaVu 2.5 no longers triggers the Firefox bug in question, but that of course doesn’t mean it has been resolved. For testing purposes one should therefore keep DejaVu 2.4 around or use any other Latin font with OpenType ligature, like for instance Junicode.

Revision history for this message
In , James Henstridge (jamesh) wrote :

What I was getting at is that a distro might want to be able to display more scripts than just the user's chosen locale (e.g. Ubuntu includes fonts for many different scripts in the default install). From this point of view, having Indic/Arabic text display correctly in non Indic/Arabic locales is desirable (especially in the web browser).

There is one modification to my steps to reproduce the bug: if using DejaVu to reproduce the bug, you must use a version < 2.5. The latest version doesn't include "liga" table entries for the ligatures in question, so the bug is not triggered (it seems that the change to the font was made because of this bug).

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

(In reply to comment #12)
> What I was getting at is that a distro might want to be able to display more
> scripts than just the user's chosen locale (e.g. Ubuntu includes fonts for
> many different scripts in the default install). From this point of view,
> having Indic/Arabic text display correctly in non Indic/Arabic locales is
> desirable (especially in the web browser).

It certainly is desirable! and we're working on it. It's just that with FF1.5/2 that requires some fairly nasty tradeoffs.

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

(In reply to comment #11)
> For languages without complex script requirements, the non-Pango code is quite
> adequate. This includes European languages, most East Asian languages (CJK),
> and Hebrew. As far as I know, only Indic languages and Arabic (including
> Persian/Farsi) really benefit from the Pango path.

As the 0th or even 1st-order approximation, what you wrote above is more or less right, but it's not that simple. See bug 215219 comment #97. Korean has complex script requirements (unfortunately, Pango's Korean support is inferior to that of ours because my patch to Pango a few years ago never got merged). So do Hebrew, Latin, and Greek.

(In reply to comment #13)

> It certainly is desirable! and we're working on it. It's just that with FF1.5/2
> that requires some fairly nasty tradeoffs.

In retrospect, my dirty hack in bug 215219 might have been an acceptable compromise for ff 1.5. With that, MathML still works well, Arabic/Hebrew work decently, and there's little performance loss for "non-complex" scripts.

BTW, the version field for this bug is set to 1.0branch, but that's not quite right given that ff 1.0 (gecko 1.7branch) branch does not contain blizzard's patch for bug 214715. RedHat and other distros ported the patch to ff 1.0 and still includes FF 1.0 instead of 1.5 (even Fedora Core 5 has 1.0.x whose PS printing module is not so good because bug 234182 was not fixed for FF1.0/Gecko 1.7). In our tree, it's not until gecko 1.8 that his patch was incorporated.

Revision history for this message
Bruce Cowan (bruce89-deactivatedaccount) wrote :

The upload of 2.5-0ubuntu2 fixes it for me, a workaround I presume?

Revision history for this message
Stefan (stfn2) wrote :

Well does it have the ligatures? If not then yes, a workaround, and for the DejaVu fonts only.

Revision history for this message
James Henstridge (jamesh) wrote :

The new DejaVu version uses "discretionary ligature" table entries for the problem ligatures rather than normal ligature table entries. Pango doesn't use the discretionary ligature tables, so the firefox pango renderer bug is not triggered.

So the bug still exists, but the likelyhood of an Ubuntu Dapper user running into it now have been greatly reduced.

Revision history for this message
Ben Laenen (benlaenen) wrote :

As a DejaVu developer: yes, we did make the ligatures discretionary so Firefox wouldn't have problems. We decided to do that because a lot of users experienced this problem, although every possible workaround automatically disables ligatures in Pango too. But we just have to make sure that the font is displayed good for everyone.

We want to make them normal ligatures again when this thing gets fixed in Firefox, and hope that happens as soon as possible.

Revision history for this message
Matt Zimmerman (mdz) wrote :

It seems to me that the workaround reduces the severity of this bug; adjusting accordingly

Revision history for this message
Stefan (stfn2) wrote :

I don’t agree. It may decrease the severity of the overall _situation_ for Ubuntu users, but it does nothing to decrease the severity of the Firefox bug as such. For any webpage that requests a font besides DejaVu that uses ligatures, and for any user who would like to set another font with ligatures as his default, the bug is still there in full force. And it makes text illegible, text that can be in online payment forms, contracts, etc.! If that isn’t major, then I don’t know what is.

Also, it seems to be the same bug that breaks display of Devanagari when rendered justified, see e.g. the first entry in

http://depts.washington.edu/ebmp/bibliography.php

(for comparison, switch off the style sheet on that page).

So the Firefox developers _really_ need to get their act together and implement proper non-buggy Pango support. And until they are done doing that (it will be a year or so), the Ubuntu Firefox packagers just have to think of something to alleviate the problem – something less feeble than switching off ligatures in this or that individual font (which as a sideeffect, of course, deprives all the rest of the GUI of ligatures, where they worked just fine).

Now I don’t want to get into a game where somebody decreases the severity of this bug, then I increase it again, and so an ad infinitum. So please do let me know whether you agree with my reasoning above, and if not please tell me why, before I go and change the severity back to Major. Thank you.

Revision history for this message
Jordi Mallach (jordi) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

On Wed, May 03, 2006 at 09:52:51PM -0000, Stefan wrote:
> I don’t agree. It may decrease the severity of the overall
> _situation_ for Ubuntu users, but it does nothing to decrease the
> severity of the Firefox bug as such. For any webpage that requests a
> font besides DejaVu that uses ligatures, and for any user who would
> like to set another font with ligatures as his default, the bug is
> still there in full force. And it makes text illegible, text that can
> be in online payment forms, contracts, etc.! If that isn’t major,
> then I don’t know what is.
>
> Also, it seems to be the same bug that breaks display of Devanagari
> when rendered justified, see e.g. the first entry in
>
> http://depts.washington.edu/ebmp/bibliography.php
>
> (for comparison, switch off the style sheet on that page).
>
> So the Firefox developers _really_ need to get their act together and
> implement proper non-buggy Pango support. And until they are done
> doing that (it will be a year or so), the Ubuntu Firefox packagers
> just have to think of something to alleviate the problem – something
> less feeble than switching off ligatures in this or that individual
> font (which as a sideeffect, of course, deprives all the rest of the
> GUI of ligatures, where they worked just fine).
>
> Now I don’t want to get into a game where somebody decreases the
> severity of this bug, then I increase it again, and so an ad
> infinitum. So please do let me know whether you agree with my
> reasoning above, and if not please tell me why, before I go and change
> the severity back to Major. Thank you.

I agree with Matt that the severity of this bug has decrease, even if it
has been aleviated by a fix in just one font.

The fix on that one font will apply to, I'd guess, 90% of the Ubuntu
users. Evidently, the bug exists for non-latin scripts, etc. but the
common usecase is this, which now works correctly.

Lowering the severity doesn't mean the bug is fixed. It just means it
won't hit so hard.

Jordi
--
Jordi Mallach Pérez -- Debian developer http://www.debian.org/
<email address hidden> <email address hidden> http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/

Revision history for this message
Stefan (stfn2) wrote :

Jordi: I understand what you are saying. But one of my main points was that people don’t browse the net with just one font. Even if a user does set a non‐ligature version of DejaVu as his default font, he will in his browsing constantly encounter pages that request and use other fonts that may be rendered brokenly.

So while shipping with a non‐ligature version of DejaVu does somewhat alleviate the Firefox problem, in a way it does not go far enough. It pains me to say so, but as long as the Firefox rendering is broken, maybe the cleanest way would be to disable rendering of Latin‐script ligatures at the Pango level? Justified Devanagari in Firefox would of course still be broken then, and there would be no ligatures anywhere on the desktop. In other words, the same situation as in Breezy. The only real solution will be for Firefox’s Pango handling to be fixed once and for all, but it seems highly unlikely now that this will happen in time for Dapper.

Revision history for this message
Simos Xenitellis  (simosx) wrote :

You mention here to "disable rendering of Latin‐script ligatures at the Pango level". How is this done?
Having a special custom pango library might not be acceptable. If this could be arranged from fontconfig (/etc/fonts/fonts.conf), then that would be a solution. However I don't this that's possible.

Checking the alternatives and the tight timetable of Dapper, the "no ligature" solution appeared the most suitable.
Indeed, the proper solution is to get Firefox fixed, but it looks there are no people currently available to do so.
I don't know if the task is small enough to be completed by a Summer of code entry.

Revision history for this message
Stefan (stfn2) wrote :

Simos: I don’t know if there is a runtime option to disable the new (and much appreciated!) Latin ligature support in Pango. This would maybe have to take the form of an Ubuntu‐only temporary patch to Pango. Or maybe one could statically link just the Ubuntu Firefox against such a patched Pango, and keep a regular ligature‐enabled Pango for the rest of the system? (Sorry, as you can tell, I am not very sure what is technically feasible.)

As for fixing Firefox itself, please see the link to the upstream bug above, and Robert O’Callahan’s blog entry at:

http://weblogs.mozillazine.org/roc/archives/2006/02/post_1.html

It sounds like they are on it, but that it will take a long time for this work to be finished (in Firefox 3.0, maybe, late next year). Another question is whether some acceptable partial solution could be backported before then.

Revision history for this message
rusty0101 (rusty0101+launchpad) wrote :

From what I am seeing, this is not restricted to firefox/mozilla. I am seeing the same behaviour with FreeMono in Gedit. I have not tested the other Free fonts, but suspect the behaviour will be the same.

As a suspicion, I would suspect that the effect will ultimately be noticed in any application using the Pango font rendering tools. It may be an error in the font itself that Pango is having issues with.

Ubuntu Dapper Drake 6.06

Revision history for this message
Ben Laenen (benlaenen) wrote :

rusty0101 wrote:
"From what I am seeing, this is not restricted to firefox/mozilla. I am seeing the same behaviour with FreeMono in Gedit. I have not tested the other Free fonts, but suspect the behaviour will be the same."

Can you post a screenshot?
I doubt that the issues are the same, since Pango generally handles ligatures nicely, and because this bug is produced by some weird Firefox quirks. I think Pango is just confused because it's a monospaced font. The Firefox bug happens with any font that has ligatures (including non-monospaced ones).

Changed in firefox:
status: Unconfirmed → Confirmed
Revision history for this message
In , 5-admin-globalcurves-com (5-admin-globalcurves-com) wrote :

You can easily see this bug by going to google and searching for anything:

Here's and example: http://www.google.com/search?hl=en&lr=&q=Mozilla+Firefox&btnG=Search

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

This issue is still open upstream.

Revision history for this message
Ilmari Vacklin (wolverian) wrote :

I see this on Feisty in Epiphany, with Pango rendering enabled.

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

properly submitted upstream ... marking as 'In Progress'

Changed in firefox:
assignee: nobody → mozillateam
status: Confirmed → In Progress
David Farning (dfarning)
Changed in firefox:
assignee: mozillateam → mozilla-bugs
Revision history for this message
Jeff Greene (jeffgreene) wrote :

This is still present in Gutsy Gibbon with the latest updates. I have attached a sample test page to see the bug in action.

Revision history for this message
In , Keenan Pepper (keenanpepper) wrote :

What's the status of this bug? Has anyone been working on it?

Revision history for this message
In , Jmdesp (jmdesp) wrote :

This problem should be solved with the new textframe code. This code will be turned on in the Fx nightlies very soon, many at the start of next week.

Roc has indicated that he is taking into account the problem on his blog http://weblogs.mozillazine.org/roc/archives/2007/05/the_glyph_bound.html, and there are patches being developed to be sure it works in all cases http://weblogs.mozillazine.org/roc/archives/2007/05/things_ive_seen.html

Revision history for this message
DivineGod (divinegod) wrote :

I have encountered this exact bug when I upgraded from Feisty to Gutsy just 3 days ago.

I have tried to investigate the nature of the bug and have come to the conclusion that either the DejaVu font set is broken in someway or that firefox renders the text wrongly.

I think it relates to the DejaVu font set because when forcing a font through the firefox preferences it appears with both serif and sans-serif versions of DejaVu. I can't find any other font on my system that create the same problem.

I post this so that this isn't forgotten.

Revision history for this message
Keenan Pepper (keenanpepper) wrote :

> I think it relates to the DejaVu font set because when forcing a font through the firefox preferences it appears with both serif and sans-serif versions of DejaVu. I can't find any other font on my system that create the same problem.

It's not a bug in DejaVu, it's a typography feature in DejaVu (ligatures) that triggers a bug in Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=331716 . It doesn't happen for the other fonts on your system because they don't have ligatures.

Revision history for this message
Keenan Pepper (keenanpepper) wrote :

It seems like this Firefox bug won't be fixed until Firefox 3.0, which won't be released until November (http://wiki.mozilla.org/ReleaseRoadmap). So, Gutsy Gibbon will ship with a buggy Firefox and we'll have to work around it with DejaVu. Is this correct?

Revision history for this message
Philipp Kern (pkern) wrote :

Then please switch the default font in Gutsy's Firefox, although that would be a bad thing aswell as the feature itself (i.e. ligatures) is quite nice. The bug is present in new installs.

Revision history for this message
John Vivirito (gnomefreak) wrote :

Gutsy users can you please run firefox from command line using the command "MOZ_DISABLE_PANGO=1 firefox" without the "" but it is case sensitive and let me know if it boosts your performance any.

Revision history for this message
Ben Laenen (benlaenen) wrote :

You can just disable the ligatures in the fonts if you want, it's not hard. We disabled them in DejaVu for a long time because of this bug. But since there was no move towards fixing it we just enabled them again because we cannot cripple our fonts just because of one buggy program. If packagers want to do it, I'm not stopping them, but I'd rather see them patching a Firefox bug instead of removing features from our fonts.

Revision history for this message
Ben Laenen (benlaenen) wrote :

MOZ_DISABLE_PANGO=1 is indeed the other way to work around the bug, but you'll lose support for a lot of non-Latin languages that way.

Revision history for this message
Bruce Cowan (bruce89-deactivatedaccount) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

On Mon, 2007-09-24 at 19:04 +0000, Ben Laenen wrote:
> You can just disable the ligatures in the fonts if you want, it's not
> hard. We disabled them in DejaVu for a long time because of this bug.
> But since there was no move towards fixing it we just enabled them again
> because we cannot cripple our fonts just because of one buggy program.
> If packagers want to do it, I'm not stopping them, but I'd rather see
> them patching a Firefox bug instead of removing features from our fonts.
>

Indeed, this is Firefox's problem, and the fact that this bug hasn't
been fixed since it appeared in Dapper shows that Mozilla don't think
much of Linux issues.

The same goes for the GTK+ themeing.

Sorry this is a rant, I'd rather have WebKit.
--
Bruce Cowan <email address hidden>

Revision history for this message
Keenan Pepper (keenanpepper) wrote :

> Indeed, this is Firefox's problem, and the fact that this bug hasn't
> been fixed since it appeared in Dapper shows that Mozilla don't think
> much of Linux issues.

Now now, don't be so hard on the Mozilla people. I'm using Gran Paradiso Alpha 7 right now and this bug is completely fixed. But it was fixed as a result of other major changes, so it can't go into an update of Firefox 2. I think it's just unfortunate timing.

Anyway, for Hardy Heron this bug will be long gone.

Revision history for this message
Bruce Cowan (bruce89-deactivatedaccount) wrote :

Sorry, I'll try to keep my opinion to the forums.

Revision history for this message
James Henstridge (jamesh) wrote :

Bruce: there are a few things to keep in mind here:

1. The pango patch is not part of Mozilla's builds. That said, most Linux distros apply the patch since upstream Firefox fails to render a number of languages they care about.

2. The version of Firefox in Gutsy uses the same rendering engine as the one in Dapper (Gecko 1.8).

3. The Mozilla guys have been working on complex text rendering (using Pango on Linux) for Gecko 1.9, but that won't reach users til Firefox 3.0.

It seems that no one with the knowledge to fix the existing Pango patch to handle ligatures has the time to do so.

Revision history for this message
Forlong (forlong) wrote :

I would prefer Ben Laenen's proposal to disable ligatures in DejaVu Sans for Gutsy, since it's the last release with this bug anyway.

For whatever reason I get this now with Gutsy on the exact same profile of Firerfox that did not have this problem in Feisty.

The only workaround for me is disabling "Allow pages to use their own fonts" and force using Bitstream Vera Sans (or any other than DejaVu). Which is not really a proper fix - as is MOZ_DISABLE_PANGO=1

Revision history for this message
Gert Kulyk (gkulyk) wrote :

Feisty did use another /usr/lib/firefox/firefox script than gutsy does, no idea, why it changed. Gutsy version does not read /etc/firefox/firefoxrc and ~/.mozilla/firefox/rc anymore, the "hack" for enabling pango only for a certain set of languages is no longer applied, too. At the moment I'm using the /usr/lib/firefox/firefox script from feisty-package on my gutsy install to workaround this, I've had no time to investigate if this is causing some serious troubles, at least it seems to work fine for me.

Revision history for this message
Forlong (forlong) wrote :

> Feisty did use another /usr/lib/firefox/firefox script than gutsy does

Thanks for the info. I guess due to that change, I get this bug as well: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/144002

I'll try switching back to Feisty's script too.

Revision history for this message
Denis Moyogo Jacquerye (moyogo) wrote :

Here a patch removing ligatures from DejaVu fonts 2.19 if that's what you want to do for the release.

Revision history for this message
Keenan Pepper (keenanpepper) wrote :

Please apply Denis Jacquerye's patch before the release candidate on Thursday!! This is a serious bug that can easily be worked around!

Revision history for this message
Steve Langasek (vorlon) wrote :

This bug has been worked around in ttf-dejavu with the upload of version 2.19-1ubuntu3:

ttf-dejavu (2.19-1ubuntu3) gutsy; urgency=low

  * Workaround: patched the fonts to disable ligatures due to a bug in
    firefox (LP #37828)

 -- Arne Goetje <email address hidden> Wed, 10 Oct 2007 12:25:02 +0800

Changed in ttf-dejavu:
status: New → Fix Released
Revision history for this message
Bruce Cowan (bruce89-deactivatedaccount) wrote :

Yay, thanks Mozilla.

Revision history for this message
Lee.Tambiah (flossgeek) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

The updates have fixed the issue here also.Thanks.

Revision history for this message
Jordi Mallach (jordi) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

On Fri, Oct 12, 2007 at 10:48:42PM -0000, Steve Langasek wrote:
> ** Changed in: ttf-dejavu (Ubuntu)
> Status: New => Fix Released

I don't think this bug should be closed before the upload of firefox3.
This is probably the best workaround for the moment, but only that.

--
Jordi Mallach Pérez -- Debian developer http://www.debian.org/
<email address hidden> <email address hidden> http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/

Revision history for this message
Jordi Mallach (jordi) wrote :

Ah, nm me, I see it fixed the "ttf-dejavu" component of the bug, not firefox's.

Revision history for this message
Steven Brown (steven-w-j-brown) wrote :

After updating, the display looks good, but it still shifts if you try to select some individual characters or strings.

Revision history for this message
Mathieu Laurent (mla) wrote :

Fixed for me ;-)

Revision history for this message
Tuttle (marianhermann) wrote :

I am unhappy with this workaround because the ligatures worked well in for example Incspape.
As a workaround it would have been sufficient not to use DejaVu in Firefox instead of affecting other programs that now suffer from an inferior typographical quality when using DejaVu.

This is not a bug in DejaVu but in Firefox, Firefox has still the same problem if a font with ligatures is used like Palatino Linotype for example.

Revision history for this message
Bruce Cowan (bruce89-deactivatedaccount) wrote :

/etc/apt/preferences :

Package: ttf-dejavu
Pin: version 2.19-1ubuntu2
Pin-Priority: 1000

Package: ttf-dejavu-core
Pin: version 2.19-1ubuntu2
Pin-Priority: 1000

Package: ttf-dejavu-extra
Pin: version 2.19-1ubuntu2
Pin-Priority: 1000

Thanks again Mozilla.

Revision history for this message
John Vivirito (gnomefreak) wrote :

This has been fixed in 3.0, last comment on upstream bug from last year states its fixed as well.

Revision history for this message
John Vivirito (gnomefreak) wrote :

This has been fixed in all bug trackers, it wasnt fixed in 1.5 as i recall due to it reaching EOLS before they were ablet o fix this. i dont remember if 1.5 got the fix or not but either way this bug has been fixed in supported browsers

Revision history for this message
John Vivirito (gnomefreak) wrote :

marking as invalid due to no update since last year and it has been fixed everywhere.

Changed in firefox:
assignee: mozilla-bugs → nobody
status: In Progress → Invalid
status: New → Fix Released
status: New → Fix Released
Revision history for this message
John Vivirito (gnomefreak) wrote :

Is anyone still seeing this issue?

Revision history for this message
James Henstridge (jamesh) wrote :

Relinking bug watches.

Changed in firefox:
status: Fix Released → Unknown
status: Fix Released → Unknown
Revision history for this message
James Henstridge (jamesh) wrote :

This bug is certainly not invalid, so please don't mark it as such. There was ample evidence of the problem.

The firefox in Hardy is not exhibiting this bug. Firefox does appear to be using ligatures for editable text for fonts that have them. It does not appear to be using ligatures for other text, so the rendering problems on pages that combine fonts-with-ligatures and justified text are gone. Therefore I'm marking the bug fix released.

Having Firefox use the available ligatures would be nice, but is not required (it is another problem and probably best tracked upstream). This is enough to allow Ubuntu's default fonts to contain ligatures without causing rendering errors.

Changed in firefox:
status: Invalid → Fix Released
Revision history for this message
John Vivirito (gnomefreak) wrote :

James fix released is fine but when the last comment is over 6 months ago without being updated its invalid because noone tells anyone when its been fix and i was never able to reproduce this. Also bug was was reported on 1.5. 1.5 is no longer supported , I suggest people update bugs more often. Honestly james invalid/fix released either way its closed .

Revision history for this message
John Vivirito (gnomefreak) wrote :

No need to keep the upstream bugs as they have been fixed and again noone has responded in a long time, if its fixed in 2.0-3.0 than they implemented the fix and thus they should be closed.

Revision history for this message
Kasper Peeters (kasper-peeters) wrote :

This problem is still present in firefox-2 in Hardy. Though I can understand that no-one wants to waste time on fixing that anymore, now that firefox-3 is the default.

Revision history for this message
James Henstridge (jamesh) wrote :

John: the upstream tasks are there to track related activity in related bug trackers. Unlinking them and changing the statuses just gives an incorrect view of their status there. If you think the upstream firefox task should be closed, bring that up at bugzilla.mozilla.org. Same goes for the Debian bug.

Kasper: I hadn't realised that firefox 2 was still found in Hardy. I guess it would make sense for a firefox 3 task to be marked fixed and a firefox 2 task open or invalid (if it was decided that no fix would be forthcoming).

Revision history for this message
John Vivirito (gnomefreak) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

James Henstridge wrote:
> John: the upstream tasks are there to track related activity in related
> bug trackers. Unlinking them and changing the statuses just gives an
> incorrect view of their status there. If you think the upstream firefox
> task should be closed, bring that up at bugzilla.mozilla.org. Same goes
> for the Debian bug.
>
> Kasper: I hadn't realised that firefox 2 was still found in Hardy. I
> guess it would make sense for a firefox 3 task to be marked fixed and a
> firefox 2 task open or invalid (if it was decided that no fix would be
> forthcoming).
>
>
James,
     So what makes you think there was a fix for this bug? If there was
a fix already upstream bug would have been marked fixed but its not. So
since there isnt a fix for it they should all be invalid. Now as for
upstream they died on the bug and since this is not a new bug and since
the firefox version that was affected at the time was 1.5 and that is no
longer supported. If i had to guess the xulrunner is what fixed this bug
but didnt fix it just works differently, that isnt really a fix. As for
upstream and debian i have already emailed my contacts at both of them
and waiting for a reply. Also please understand we(Ubuntu-MozillaTeam)
dont do bug states as everyone else does. There is plenty of info on
this bug to be "confirmed" but not fix released since there was never a
proper fix to this. Also bugs that are not updated for well over 3
months get Invalid (that goes for mozilla team and bug team) This is by
no means to fight or argue with you since it is not the place nor time
but i wanted to let you in on how Mozilla team does bugs and that this
bug was never fixed if it was upstream/debian bugs would have been closed.

Kasper, firefox-2.0 wont get a fix for this unless its bundled in with a
new security update but i doubt that Mozilla will speand a whole lot of
time on this since its not a critical bug,

--
Sincerely Yours,
    John Vivirito

https://launchpad.net/~gnomefreak
https://wiki.ubuntu.com/JohnVivirito
Linux User# 414246

Revision history for this message
James Henstridge (jamesh) wrote :

John: there are obviously ligatures in the the DejaVu font in Hardy (you can see other GTK apps using them). We can also see that Firefox is not misrendering justified text anymore, so it does look like it has been fixed. We knew that the Firefox guys were rewriting the text rendering code for 3.0 (see previous comments), so it isn't surprising that the bug is now fixed in Hardy.

Revision history for this message
Alexander Sack (asac) wrote : Re: [Bug 37828] Re: Text rendered incorrectly in presence of ligatures and justified text

On Wed, May 14, 2008 at 12:44:41PM -0000, James Henstridge wrote:
> John: there are obviously ligatures in the the DejaVu font in Hardy (you
> can see other GTK apps using them). We can also see that Firefox is not
> misrendering justified text anymore, so it does look like it has been
> fixed. We knew that the Firefox guys were rewriting the text rendering
> code for 3.0 (see previous comments), so it isn't surprising that the
> bug is now fixed in Hardy.
>

 affects ubuntu/firefox-3.0
 status fixreleased

 affects ubuntu/firefox
 status wontfix

 - Alexander

Changed in firefox:
status: Fix Released → Won't Fix
Changed in firefox:
status: Unknown → Confirmed
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Ahangama (ahangama) wrote :

The screenshots given with the original report shows as if the font maker forgot to adjust the Advance Width if the ligature glyph leaving it at the width used by the first letter of the combination. If this theory is correct, there is nothing that Mozilla should do.

Revision history for this message
In , Ben Laenen (benlaenen) wrote :

(In reply to comment #18)
> The screenshots given with the original report shows as if the font maker
> forgot to adjust the Advance Width if the ligature glyph leaving it at the
> width used by the first letter of the combination. If this theory is
> correct, there is nothing that Mozilla should do.

It's already determined long ago that the bug was in Mozilla, and it has been fixed in Firefox 3.0.

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Right, this is a 1.8 branch bug, i.e. Firefox 2 only.

Revision history for this message
In , Jmdesp (jmdesp) wrote :

IMO there's no reason to keep this open and we should WONTFIX it, as
- there's nobody strongly willing to take this bug and fix it in Firefox 2.
- even if there was someone willing to do that, I believe such a patch would have no chance of getting into the 2 branch which is now open about only for security fixes, right ?

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

WONTFIX may not be technically correct, but I'd certainly like to discourage anyone from wasting their time on this, so ... WONTFIX.

Changed in firefox:
status: Confirmed → Won't Fix
Changed in firefox (Debian):
status: Confirmed → Fix Released
Changed in firefox:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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