Closed Bug 553136 Opened 11 years ago Closed 11 years ago

text looks slightly worse due to increased or decreased text spacing

Categories

(Core :: Graphics, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b1
Tracking Status
blocking2.0 --- final+

People

(Reporter: tnikkel, Assigned: jtd)

References

Details

(Keywords: regression, Whiteboard: fixed by bug 561304)

Attachments

(7 files)

Text looks slightly worse in recent nightlies. I noticed this on Wikipedia with fullzoom one step larger. Will attach good/bad screenshots.

Regression range
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=17a3e86d5ec5&tochange=050887c64183
Looks like probably bug 502906.
Attached image good screenshot
Screenshot of http://en.wikipedia.org/wiki/Mil_Millington where the text looks good to me.
Attached image bad screenshot
Screenshot of http://en.wikipedia.org/wiki/Mil_Millington where the text looks bad to me.
It looks like we're getting tighter character spacing for some reason. Does this happen with all text sizes and all fonts? Are you able to compare behavior on newer versions of Windows as well?
I see the same on XP.
This is probably the issue I mentioned yesterday on IRC, although I saw the opposite - some texts were more widely spaced. I'm on Windows XP.
Some texts look more widely spaced for me as well (for example the label name when looking at a message in gmail). So this is probably all the same issue.

Only some fonts and/or sizes seem to be affected. For example, Wikipedia at default zoom looks the same.
OS: Windows 2000 → Windows XP
Attached image example of wide spacing
left: Firefox 3.7a4pre (20100318)
right: Firefox 3.6

This is an example of wide spacing, but in my case it's also visible on Wikipedia (default zoom, not a single font preference changed). It looks to me that the sans-serif font is suddenly monospaced or something.
Summary: text looks slightly worse → text looks slightly worse due to increased or decreased text spacing
blocking2.0: --- → ?
Today (Gecko/20100321), it seems to be fixed for me (comment 7), although I don't see any obvious reason why.
I still see this with the 20100321 nightly.
Whether I got too wide or too narrow spacing, and which places I saw the problem has changed, but the problem is still there for me with 2010-03-21 nightly as well.
My guess (without having investigated properly yet) is that the issue is a difference between hinted/grid-fitted and "ideal" glyph metrics. Perhaps the issue depends on some characteristics of the device context at the point when the glyphs get measured and stored into the textruns, or how we set up the cairo font. We should be controlling this properly so that the results are consistent, of course, but something may have been missed in the restructuring of the font code.
This is certainly much more common in the last few days, but there has been a hard-to-reproduce bug with font metrics for years; it's often triggered by non-western characters in western text, but also crops up in bits of the gmail UI, e.g. the "Search, add or invite" box.  I have a bunch of screenshots from mid-2008 and it may go back further, see bug 237438 or bug 384025.  So maybe the recent changes just make it show up more.
Interesting - yes, the screenshot in bug 237438 does look like it could be the same underlying issue, though clearly it's become more frequent since the patch in bug 502906 (part 3) landed.
Duplicate of this bug: 555747
blocking2.0: ? → final+
John, I'm assigning this to you because I know you'll make sure it gets taken care of, even if you're not the one doing the taking-care-of :)
Assignee: nobody → jdaggett
It's still here, and it's on every build, and all the time at random... so annoying.
http://forums.mozillazine.org/viewtopic.php?f=23&t=1850415
Duplicate of this bug: 562384
That's a heizenbug, very hard to reproduce reliably.

I've seen it at http://forums.kuban.ru/forum/viewforum_new.php?f=5 a number of times, sometimes only for bold font of the same family (or so I remember).

Windows XP SP3.

The bug generally disappears after I restart Firefox once or twice or thrice.

Update Notifier extension suddenly becomes very handy: it provides a toolbar button with a context menu item that restarts Firefox.
FWIW, it is always reproducible at CNN.com.  Most of links produce bad looking text.  XP SP3.
(In reply to comment #19)
> FWIW, it is always reproducible at CNN.com.  Most of links produce bad looking
> text.  XP SP3.

Not for me, at least.  All the text and links on cnn.com look the same in FF and Chrome on my machine.  Also XP SP3.
Installing and/or updating an add-on--also enabling/disabling an add-on--can (often?) trigger this bug for me. However, enabling/disabling an add-on rarely untriggers it. Where I see it most often, though, is Gmail, Gmail login page, and Google Reader.
As an experiment: Those who are able to easily reproduce this bug, I'd appreciate hearing whether the test build at

http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/jkew@mozilla.com-61ddbf901689/tryserver-win32/

behaves any differently for you. This includes one small change borrowed from bug 449292 that could potentially affect the font system, so I'm curious if it might have any impact here.
Jonathan, I just tested the tryserver build, but I still see this problem.  The problem doesn't seem to be completely deterministic normally, so I don't know if it's occuring with the same frequency, but I definitely saw looser character spacing on www.thedigitalbits.com and also Slashdot.
The cause of this is bug 561304, a regression bug caused by the restructuring work done for bug 502906.  Prior to these changes, Windows font code always used GDI shaping at smaller font sizes and Uniscribe shaping for larger sizes to get kerning and ligatures.  But there's a bug in Uniscribe shaping under XP, it does weird glyph placement at some smaller sizes.  In the attached testcase note how the text for 14px Arial is smushed under XP, it renders with the same positions as 13px text.  The "weird" sizes vary by font.
Trunk renderings on Windows XP and Windows 7, both with Cleartype disabled.  Note the funky rendering on XP with Arial at 14px.  God I love Windows...
Jonathan, I too tried your build in a pristine state and still have the same problem on most links at CNN.com.
If this is caused by bug 561304, then zooming a problem page and increasing the font size should make the problem go away.  I just tried it on a page that had loose spacing, and it does seem to improve the character spacing when I zoom the text.
I have just noticed that _decreasing_ the font size (e.g. Ctrl+minus) reliably makes the problem go away. You are very likely to be right about this bug connected with bug 561304 some way.
(In reply to comment #22)
Using the test build I don't see any difference, i.e. the problem is still visible.
(In reply to comment #30)
> (In reply to comment #22)
> Using the test build I don't see any difference, i.e. the problem is still
> visible.

Yes, that doesn't appear to be relevant; thanks to those who confirmed this.

It seems that John's diagnosis in bug 561304 is a key to this; I still don't understand the intermittent nature of the problem, though.
(In reply to comment #28)
> If this is caused by bug 561304, then zooming a problem page and increasing the
> font size should make the problem go away.  I just tried it on a page that had
> loose spacing, and it does seem to improve the character spacing when I zoom
> the text.

Is the zoom and reset to "correct" this for the test builds only? I tried on the regular nightly builds, but did not see things return to expected.
FWIW, I'm seeing the weird spacing effects happening in random places and at random times using older Gecko like SeaMonkey 2.0.5 (my primary browser).  Usually when I restart the application I'm no longer seeing the effect at the same place I've just seen.  I use a default sans-serif (Arial) font at 14px size.  The shot is taken from <http://www.w3.org/TR/html401/> - look at the sentences starting with "Public discussion" and "Please report errors".
> Is the zoom and reset to "correct" this for the test builds only? I tried on
> the regular nightly builds, but did not see things return to expected.

Zoom and reset does not correct anything.

When you just zoom out (Ctrl+Minus without further Ctrl+0 resetting), you are likely to correct some spacing in the main block of text, if it was broken (however, some other text, previously rendered correctly, may become broken, e.g. headings or navigation links).
(In reply to comment #33)

> FWIW, I'm seeing the weird spacing effects happening in random places and at
> random times using older Gecko like SeaMonkey 2.0.5 (my primary browser). 
> Usually when I restart the application I'm no longer seeing the effect at the
> same place I've just seen.

In Firefox 3.7 alpha 4 and nightlies that's far worse (i.e. more often), and does not automagically disappear after restart.
Try server build with bug 561304 patch v.0.1a
http://bit.ly/9GFdIO

If folks who are seeing this problem could test with this build I'd appreciate it.  If there are specific zoom settings that still produce rendering that is worse than 3.6, please try and isolate it down to a specific font family / size combination if at all possible, that would be a huge help.
John, I just tried your test build and it works!  At least it does on the CNN.com links, which is where I have usually observed it.  Text looks find again just like in 3.6.
I meant text looks fine again.  Is there a way to edit a post?
Problem fonts/sizes:
Arial 14px
Georgia 16px
Times New Roman 13px
Trebuchet MS 14px

Testcase showing problem fonts/sizes:

http://people.mozilla.org/~jdaggett/tests/bug553136-extended.html
(In reply to comment #36)
> Try server build with bug 561304 patch v.0.1a
> http://bit.ly/9GFdIO

Looks o.k. - same as 3.6.

(In reply to comment #39)
> Problem fonts/sizes:

Using attachment 448444 [details] from Bug 561304 I'm also observing similar symptom with the Sylfaen font at 18px, but then it looks the same with 3.6, also.
(In reply to comment #40)
> Sylfaen narrower at 18px than 17px

Just to point out - font sizes 10px, 11px and 12px look the same as I have 12px minimum font size set.
The tryserver build works for me.  I didn't see any instances of the spacing problem on sites I commonly visit.
Please land some patch (even if not final) in Firefox 3.7 alpha 5.
(In reply to comment #43)
> Please land some patch (even if not final) in Firefox 3.7 alpha 5.

The patch on 561304 is under review, that should fix this.
Fixed in bug 561304.  If you're still seeing problems, reopen.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Resolution: WORKSFORME → FIXED
Whiteboard: fixed by bug 561304
Target Milestone: --- → mozilla2.0b1
Duplicate of this bug: 237438
You need to log in before you can comment on or make changes to this bug.