Closed Bug 628091 Opened 13 years ago Closed 13 years ago

Type1 fonts in Firefox UI and on web pages show up as squares with hex codes

Categories

(Core :: Graphics, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- -

People

(Reporter: jack.yan, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(5 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 GTB7.1 ( .NET CLR 3.5.30729)
Build Identifier: ftp.mozilla.org/pub/firefox/nightly/4.0b10-candidates/build1/unsigned/win32/en-US/firefox-4.0b10.zip

Nothing in Firefox is legible. ‘File Edit View’ etc. are all in square characters with hex codes inside them; some web pages display this way as well.

Different users are reporting different sites being illegible. It is _not_ tied to any one particular font family or font format conflicts.

Reproducible: Always

Steps to Reproduce:
1. Open Firefox.
2. Visit sites—try to read!
3.
Actual Results:  
Nothing in the Firefox UI itself is readable.

Various sites are unreadable, as though the font is not installed.

Different users are reporting different sites being illegible. It is _not_ tied to any one particular font family or font format conflicts.

Expected Results:  
I expect to be able to read the menus in Firefox, rather than guess at them. No other program has this bug.

I expect web pages to be in the font specified or in the default chosen.

See these links for examples of this bug:

https://support.mozilla.com/hy-AM/questions/749543/
http://jackyan.com/blog/2011/01/jack-tries-another-firefox-betawe-all-know-what-happens-next/
Attaching this as it’s a small file that is indicative of this bug.
This was the smallest I had on file, of what this bug looks like. Note that nothing in Firefox is readable; neither is the text on the page.
Attachment #506198 - Attachment description: A typical web page on Firefox 4 Beta 7–10 → A typical web page on Firefox 4 Beta 7–10 (website visited: www.aisleone.net)
blocking2.0: --- → ?
Component: General → Layout: Text
Product: Firefox → Core
QA Contact: general → layout.fonts-and-text
I am wondering (have mentioned it elsewhere, but am adding it here for completeness) whether this is an incompatibility between PS1 and Firefox 4.
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13)
> Gecko/20101203 Firefox/3.6.13 GTB7.1 ( .NET CLR 3.5.30729)
> Build Identifier:
> ftp.mozilla.org/pub/firefox/nightly/4.0b10-candidates/build1/unsigned/win32/en-US/firefox-4.0b10.zip

Have you tried this with the latest nightly builds?

I put in some logging last week to help with this situation.  Could you run with the steps below and attach the results?

1. Add two environment variables (Control Panels > System > Advanced tab > Environment variables) as user variables, replacing 'username' with whatever your local username is on your system:

  NSPR_LOG_MODULES=fontlist:5,textrun:5,textrunui:5
  NSPR_LOG_FILE=c:\users\username\Desktop\fonts.log

2. Then run the latest nightly build and open up pages that demonstrate the problem.

3. Quit Firefox

4. Delete the environment variables (important!!)

This will dump a file 'fonts.log' on your desktop with details on all text rendered and the font chosen for each text run, both for content and ui. Each time you run Firefox the previous file will be deleted.  If you attach that we can investigate the cause of the problem.
Component: Layout: Text → Graphics
QA Contact: layout.fonts-and-text → thebes
Version: unspecified → Trunk
(In reply to comment #3)
> I am wondering (have mentioned it elsewhere, but am adding it here for
> completeness) whether this is an incompatibility between PS1 and Firefox 4.

What's PS1 in this context?
Hi John:

Beg your pardon, I meant Adobe PostScript Type 1.

I will try your logging now and get back to you. Thank you for your help!
John, here is my fonts.log based on the latest Firefox 4 Beta 10 build. It appears at first glance to me that the problematic fonts are PostScript Type 1 (which is something that this file might not reveal).
Thanks Jack, it looks like you're picking up HelveticaNeue-Roman for Helvetica (and in other cases).  I think this may be a problem with our handling of Type1 fonts on XP, let me do some investigation.
Summary: All characters in Firefox UI and on web pages show up as squares with hex codes → Type1 fonts in Firefox UI and on web pages show up as squares with hex codes
Hi John: you may be right there. I think I might have this in the FontSubstitutes in the registry on that particular machine (a long story) and I can confirm that HelveticaNeue-Roman is a PS1 font on that PC.
Looks like this was broken by bug 577065. Type 1 fonts get a GDIFontEntry where mForceGDI is TRUE, but then the change in gfxGDIFont::InitTextRun insisted that it should use Uniscribe for "non-TrueType" fonts... the Uniscribe shaper fails, but then it won't fall back to GDI shaping. This patch enables such fonts to work again.
Assignee: nobody → jfkthame
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #506366 - Flags: review?(jdaggett)
Blocks: 577065
Keywords: regression
Note that the problem does not show up if we're using DirectWrite, which is the case whenever D2D is enabled. So reproducing the issue may require explicitly disabling D2D (depending on your system capabilities).
Hooray, Jonathan: I’m looking forward to the next build to see how it all goes.
Blocks: 578829
Can we have a test for type1 font rendering? Are there any free Type1 fonts?
(In reply to comment #13)
> Can we have a test for type1 font rendering? Are there any free Type1 fonts?

Note that we would need to install these on test machines, we can't load Type1 fonts via @font-face rules.
Robert and John, I could email you a couple of ours that we own the rights to, provided they are deleted after the testing.
Free fonts converted to PS1 for installation and testing.
I'd release with this bug, but I'll also approve the patch on it once it's reviewed. :)
blocking2.0: ? → -
I’m happy to try it on my system if the patch makes its way on to the nightly builds. (Being a layman I mightn’t be able to be more in-depth.)
(In reply to comment #18)
> I’m happy to try it on my system if the patch makes its way on to the nightly
> builds. (Being a layman I mightn’t be able to be more in-depth.)

It won't go into nightly builds until the patch is reviewed and committed, but if you want to try it in the meantime I've done a tryserver build, which you can get at http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/jkew@mozilla.com-dd5ca134a7d5/try-w32/.
Thank you, Jonathan. I’ve visited all the sites that were causing me trouble before and they are all displaying perfectly. Keeping my fingers crossed that the patch is reviewed and committed!
Here is one tiny and very strange one: the digit eight is not displaying on one PostScript font! Chrome does this as well:

http://jackyan.com/blog/2010/12/and-now-chrome-changes-fonts-on-some-numerals/

When I had the earlier trouble, 8 was the only glyph in this font that displayed; I didn’t check the others.

Not sure if it’s the font, but I will open it up to see if there are any errant vectors in the 8 slot. The pages where it’s done this do lack a doctype, so maybe that is the issue. I could not re-create the 7 bug that I wrote in the above but it may be down to the different systems and set-ups.

This is really minor, I know. Not sure if it is related.
Attachment #506366 - Flags: review?(jdaggett) → review+
Comment on attachment 506366 [details] [diff] [review]
patch, fix GDI rendering of PFB fonts

Requesting approval to land on trunk for 2.0. This fixes a bad regression for people with old Type 1 fonts on Windows GDI.
Attachment #506366 - Flags: approval2.0?
Comment on attachment 506366 [details] [diff] [review]
patch, fix GDI rendering of PFB fonts

It's too bad it's so hard to test this.
Attachment #506366 - Flags: approval2.0? → approval2.0+
Joe, if you like, I made two PS1 versions of PT Sans in an earlier attachment that you can install. The fonts are called PTSans, so they shouldn’t conflict with the same fonts if you already have them in OpenType or TrueType.

I have made a very simple HTML page (two lines) at http://jackyan.com/ptsans.htm.
Jonathan, does your tryserver build have the logging that John mentioned in comment no. 4? I wouldn’t mind discovering the source of my mystery 8s.
Pushed: http://hg.mozilla.org/mozilla-central/rev/5769afe9da46
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
(In reply to comment #25)
> Jonathan, does your tryserver build have the logging that John mentioned in
> comment no. 4? I wouldn’t mind discovering the source of my mystery 8s.

Should do, I believe, if that code was already in the main repository. Or you could try with tomorrow's nightly, as I've just landed this fix.
(In reply to comment #24)
> Joe, if you like, I made two PS1 versions of PT Sans in an earlier attachment
> that you can install. The fonts are called PTSans, so they shouldn’t conflict
> with the same fonts if you already have them in OpenType or TrueType.

Thanks for offering these. It's simple enough for us as individuals to install some PS Type 1 fonts, whether yours or any others we happen to have, and test this. The issue Joe is referring to is that it's considerably more work to integrate into our automated continuous-testing setup, as that would involve adding custom fonts to the OS image used on all our test machines; plus, _every_ developer who wants to run the full test suite locally would have to install the fonts, too, in order to avoid test failures.

So altogether that's vastly more hassle just installing some fonts by hand on a single system. For most font-related tests that require specific fonts, we just use @font-face to include the fonts as part of the test suite, but that approach doesn't support Type1 fonts.
Blocks: 629386
Jonathan, I understand—thank you for explaining it to me.
Hi guys:

I have started a new report given that this is three years old, but it appears this bug has resurfaced as of the latest Firefox update. I’m not getting the boxes this time: the text simply does not appear. I wonder if it’s related.
(In reply to Jack Yan from comment #31)
> Hi guys:
> 
> I have started a new report given that this is three years old, but it
> appears this bug has resurfaced as of the latest Firefox update. I’m not
> getting the boxes this time: the text simply does not appear. I wonder if
> it’s related.

In support of Jack Yan, this problem has returned following an update about 2 weeks ago. I reviewed the config file in a tab and I AM allowing downloadable fonts.  Also in setting I am allowing the page to determine the fonts. But many pages are now completely unreadable to me.  

I then loaded the BETA version ... which has been updated twice since I loaded it. Each time I was hopeful I'd see a fix to this problem but there has been no fix.  Sadly, I find myself having to use Explorer, again in order to see these sites.
(In reply to Lizanne from comment #32)
> 
> I then loaded the BETA version ... which has been updated twice since I
> loaded it. Each time I was hopeful I'd see a fix to this problem but there
> has been no fix.  Sadly, I find myself having to use Explorer, again in
> order to see these sites.

Hi Lizanne:

Thank you for backing me up on this one. Tonight I downloaded Cyberfox, which seems to be working. It’s on the Firefox architecture so everything is where you expect it to be. The down side: you have to import your bookmarks from the Firefox JSON directory and redo all your preferences (including add-ons).

Given that it forces us to have a new profile, I wonder if there is something in the old that is causing this (though I can’t imagine what it would be, and starting in safe mode does nothing to change the invisible text in Firefox and Waterfox 34).

This may be better than resorting IE, anyway.

I notice the fonts render differently in Cyberfox, and some of the fonts I have do not show up in the menu, but having something that actually is capable of displaying text is nice!

The other option I used was to go back to Waterfox 32, which was the last one they made that displayed text on my system. But then you are stuck with something based on an earlier Firefox. Waterfox is also 64-bit only, so if you are on a 32-bit machine, it won’t be compatible.
Lizanne, please disregard the above. On rebooting, Cyberfox does exactly the same thing. I wish software would be consistent!
Reinstallation fixed that, although reinstalling software on a daily basis is not a fix!

What is very interesting: when Cyberfox failed, the text that it would show was rasterized in exactly the same way as Firefox and Waterfox. This was not the case last night and it is not the case on reinstallation. It has its own method of rendering type. 

The method of rendering is that fix, but knowledge of that is beyond me.
Lizanne, if you are there, I found the culprit.

Everyone seems to advise that you should turn off hardware acceleration.

The solution is the opposite: turn on hardware acceleration. I did that just now and the type came back. (You will need to restart your browser after turning it on, presuming you can see where that box is, since I know all the menus are blank.)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: