Closed Bug 1771496 Opened 2 years ago Closed 1 year ago

Text overlapping when FontBase is used on macOS to activate "Brady Bunch" and "Arial Bold"

Categories

(Core :: Layout: Text and Fonts, defect)

All
macOS
defect

Tracking

()

RESOLVED DUPLICATE of bug 1803406
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- wontfix
firefox100 --- unaffected
firefox101 --- unaffected
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox107 --- wontfix

People

(Reporter: rpopovici, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files, 1 obsolete file)

Affected OS:
M1 Mac 11.6
MacOS 11
MacOS 12

Affected version:
Nightly 102.0a1(2021-05-27)

Preconditions:
Please make sure to use all the Font Managers listed below while testing and activate all the fonts at once. Verify that they are active on Google page.

FontBase: " https://fontba.se/ " and the Font Pack is imported and activated within the app.
Before uninstalling the active font manager, please make sure to deactivate all the fonts used, and only then to install another one.

Steps to reproduce:

Open firefox
Access the following websites: https://google.com/search and gmail.com(compose mail) or bbc.com
Actual result:
Text is overlapping on google and gmail.com

Expected result:
Text is properly displayed on google and gmail.

Note: This happens only on MacOS. See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1729007

Has Regression Range: --- → yes
Has STR: --- → yes
Regressed by: 1696504

:glandium, since you are the author of the regressor, bug 1696504, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(mh+mozilla) → needinfo?(jfkthame)

Set release status flags based on info from the regressing bug 1696504

Severity: S3 → S2

[Tracking Requested - why for this release]: Let's try not to ship this very visible regression, even though it happened in M1 macs before (bug 1729007).

See Also: → 1729007

We have limited time to fix this in 102, the soft freeze is in two weeks and the bug still isn't assigned.
Should we ship with this regression or backout the regressor?

Ralu, question for you -- just to clarify this bug and the connection to older bug 1729007 (whose symptoms sound the same).

If I'm understanding correctly: the bug here (the regression w/ range in comment 1) is simply that the problem-you-described-in-bug 1729007 now also affects Intel-based macs as well (whereas before the regression range in comment 1, it only affected M1 macs).

Is that correct? (i.e. this bug and bug 1729007 are the same issue, but this bug here is about it also affecting macs with intel chips?) That would makes sense, given the regression range that you identified, but I just want to be sure that matches your testing experience.

Flags: needinfo?(raluca.popovici)

Also: as someone not familiar with FontBase, I'm somewhat unclear on the STR. I've got a few questions for clarification, in addition to my question from comment 6.

(In reply to Ralu from comment #0)

Preconditions:
Please make sure to use all the Font Managers listed below while testing and activate all the fonts at once. Verify that they are active on Google page.

Question 1: To "Activate all the fonts at once" per your instructions, should I just click the empty-circle to the left of "Inactive" in the Fontbase app? (This seems to trigger a long operation which I'm waiting on to complete; I assume maybe it's downloading and activating a lot of fonts, but I'm not sure.)

Question 2: Could you elaborate on what you mean by "Verify they are active on Google page"?

FontBase: " https://fontba.se/ " and the Font Pack is imported and activated within the app.

Question 3: What font pack needs to be imported and activated? (I did a web-search for "FontBase Font Pack", and it didn't turn up any specific obvious thing-to-download-and-import...) I do see that freshly-installed FontBase automatically seems to offer me 3795 fonts under PROVIDERS|Google (no need to explicitly import anything for those to show up as being available). Is that the font pack you're talking about (which is automatically available and just needs to be activated), or is there something else that needs to be explicitly imported?

Before uninstalling the active font manager, please make sure to deactivate all the fonts used, and only then to install another one.

Question 4: I'm not sure what you mean here about uninstalling/deactivating/installing. Does the STR require that you uninstall/deactivate some other font manager before installing FontBase?

Question 5:
Is the "Activate all the fonts at once" step actually necessary to trigger this bug? (I imagine there's only one particular font which being used by the problematic text in your screenshots, and it's conceivable this is just a bad interaction with that one font. Could you see if you can find out what that font is, by e.g. right-clicking the google.com "I'm Feeling Lucky" button (when you've got it looking broken per bug 1729007 comment 2) and choosing "Inspect" and then looking in the "Fonts" panel (which might be hidden under a dropdown arrow at the right side of devtools)?

Once you know what that font is, I'm curious if you can reproduce this bug if you only activate that one font in FontBase. (If so, that's faster/easier/more-targeted than activating everything.)


Also, for what it's worth: I just attempted to reproduce this and wasn't able to do so, though I might be missing a step (per my above clarification questions). I'm using an Intel-based MacBook Pro, with macOS 12.4. I installed and launched FontBase, and clicked the empty circle next to "Inactive", and then I waited ~10 minutes for that operation to complete; then "Active" showed "3788" and "Inactive" showed "7" (for fonts which were unable to be activated for some reason). All of these (3788+7) are from the available-by-default "Google" provider (which lists 3795 fonts). At this point, I opened Firefox Nightly and went to https://www.google.com and also to gmail's compose-new-message UI, and I was unable to reproduce the overlapping-characters issues that are shown in your screenshots on bug 1729007. So I'm missing a step, I think (possibly something that will be clarified by your answers to my questions above).

FWIW, I just tried this on my M1-based MacBook Air (macOS 12.4), and like Daniel, was not able to reproduce.

Flags: needinfo?(jfkthame)

In the meantime, I think we can consider this S3 rather than S2, since the impact probably isn't as large as I was worried it might be when I bumped the severity above

(given that it requires a particular piece of external software, with a particular configuration that jfkthame and I haven't yet been able to recreate)

Severity: S2 → S3

(In reply to Marco Castelluccio [:marco] from comment #5)

We have limited time to fix this in 102, the soft freeze is in two weeks and the bug still isn't assigned.
Should we ship with this regression or backout the regressor?

Answering this question: at this point I don't think we should backout, per my reasoning in comment 10 (and since we've been shipping this behavior for users-on-M1-chips for 9 months, per bug 1729007, apparently without affecting many users, given the lack of signals from users on that bug).

We might learn more and reassess once we've heard back from Ralu on the questions in comment 6 - comment 8 and are hopefully able to reproduce the issue locally, though.

The severity field for this bug is set to S3. However, the bug is marked as tracked for firefox102 (beta).
:jfkthame, could you consider increasing the severity of this tracked bug?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jfkthame)

As Daniel notes in comments 10 and 11, it looks like this may have quite limited impact; we have no indication at present that it will affect many users. So no, I don't think severity should be increased at this time.

Flags: needinfo?(jfkthame)

Given the recent updates, I guess we don't need to track anymore. Do you agree?

Flags: needinfo?(pascalc)
Flags: needinfo?(pascalc)

Question 1: To "Activate all the fonts at once" per your instructions, should I just click the empty-circle to the left of "Inactive" in the Fontbase app? (This seems to trigger a long operation which I'm waiting on to complete; I assume maybe it's downloading and activating a lot of fonts, but I'm not sure.)
Answer: Yes, you need a freshly-installed FontBase automatically that offers 3795 fonts under PROVIDERS|Google (no need to explicitly import anything for those to show up as being available). Is the the font pack that you need for testing (which is automatically available and just needs to be activated).

Question 2: Could you elaborate on what you mean by "Verify they are active on Google page"?
Response: Go to google.com, search by an item and the results will appear with different font.

Question 3: Is that the font pack you're talking about (which is automatically available and just needs to be activated), or is there something else that needs to be explicitly imported?
Answer: Yes, like I said to the first question, all you need is a freshly-installed FontBase

Question 4: I'm not sure what you mean here about uninstalling/deactivating/installing. Does the STR require that you uninstall/deactivate some other font manager before installing FontBase?
Answer: No need for this step if you don't have an old Font Base.

Question 5:
Is the "Activate all the fonts at once" step actually necessary to trigger this bug? (I imagine there's only one particular font which being used by the problematic text in your screenshots, and it's conceivable this is just a bad interaction with that one font. Could you see if you can find out what that font is, by e.g. right-clicking the google.com ?
Answer: On M1 I already have all fonts actived by previous testing. Today I don't have acces to the M1, maybe tomorrow if I have time to verify.

Flags: needinfo?(raluca.popovici) → needinfo?(dholbert)

I attached a screenshot with the browser console. The used font: font-family: arial,sans-serif;
font-size: 14px;

This issue is reproducible for https://kidshealth.org/ with font-family: Arial,Helvetica Neue,Helvetica,sans-serif. Please see screenshot.

Following up on one thing I posted earlier:
(In reply to Daniel Holbert [:dholbert] from comment #8)

I [...] clicked the empty circle next to "Inactive", and then I waited ~10 minutes for that operation to complete; then "Active" showed "3788" and "Inactive" showed "7"

Good news for others investigating/testing this: this operation only takes ~10 minutes the first time you do it (presumably it's downloading all the fonts). Now, it only takes a few seconds. (And I don't have 7 inactive fonts anymore; all of the 3795 fonts become active for me now.

(In reply to Ralu from comment #15)

Question 2: Could you elaborate on what you mean by "Verify they are active on Google page"?
Response: Go to google.com, search by an item and the results will appear with different font.

OK, hmm. For me, Google search results do not look any different (no change in font, no overlap). So there's some additional step/bit-of-configuration that I'm missing.

(Also, https://kidshealth.org/ and https://bbc.com/ look the same for me regardless of whether I've activated/deactivated all 3795 fonts.)

Question 5:
Is the "Activate all the fonts at once" step actually necessary to trigger this bug?
Answer: On M1 I already have all fonts actived by previous testing. Today I don't have acces to the M1, maybe tomorrow if I have time to verify.

Thanks. Either M1 or Intel would both be fine for testing this I think, since I think (?) you can reproduce on both.

My shot-in-the-dark theory right now (to explain why I'm seeing different results from you) is: maybe you don't have the actual Arial font available locally, and so Firefox uses some fallback, and the fallback font that Fontbase provides to you is not working for some reason.

(There might also be some locale-specific reason for the difference, I suppose, whether on the macOS system side [e.g. different default platform fonts], Firefox's side, or the website.)

Anyway: here are a few additional questions for you that would help get us closer to identifying the problem:

(1) At an affected site, could you inspect some affected text and tell us what Firefox's "Font Inspector" Developer tool reports as the actual font that's being used (which may not necessarily match the web developer's requested font-family, depending on availability)? The font inspector is hidden in the dropdown arrow at the top-right of DevTools, just underneath the "x". Please report back the font that's being used in both conditions (when FontBase's fonts are active [bad layout] and inactive [good layout]).

(2) I'll post a simple testcase with just font-family:Arial which I'm guessing will reproduce the bug for you, based on comment 16 and 18. It would be great if you could confirm whether this testcase is affected. (Presumably it will show the same font in the font inspector as the other affected sites do.)

Flags: needinfo?(dholbert) → needinfo?(raluca.popovici)

(Notably, "Arial" is not a font that's available from Google in FontBase. If I scroll down through the list alphabetically, it goes Aref Ruqaa to Arima Madurai, skipping over the spot where Arial would hypothetically sort. So: that means we're not simply getting a broken Arial font from FontBase, for example.)

Attached file testcase 1

(In reply to Daniel Holbert [:dholbert] from comment #20)

(2) I'll post a simple testcase with just font-family:Arial which I'm guessing will reproduce the bug for you,

Here's that testcase - please confirm whether you see the issue here. (A screenshot would be great, assuming you do see the issue.)

In case testcase 1 doesn't reproduce the issue, then try this one instead -- this one's slightly-more-complex, and uses styles/content taken directly the very top of kidshealth.org (a section that's broken in your screenshot).

(If testcase 1 does reproduce the issue, then you can disregard this one and let's just focus on testcase 1.)

(In reply to Daniel Holbert [:dholbert] from comment #20)

(There might also be some locale-specific reason for the difference, I suppose, whether on the macOS system side [e.g. different default platform fonts], Firefox's side, or the website.)

Checking the locale is a good idea - in the past we've had bugs which only occurred when the macOS system language was set to something other than English.

Ralu, just a reminder, we could use your help to proceed here (see comment 20 and beyond). Thanks!

Sorry, there was a problem with the detection of inactive users. I'm reverting the change.

Flags: needinfo?(jfkthame) → needinfo?(raluca.popovici)

Hi Ralu, checking in again: if you can still reproduce, could you answer questions (1) and (2) at the end of comment 20?

Flags: needinfo?(raluca.popovici)
Flags: needinfo?(raluca.popovici)

Closing as INCOMPLETE, per comment 28, pending more information about whether this is still reproducible or how to repro.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE

@dholbert, sorry for the late reply, but I was very busy with features testing. I was able to reproduce this bug(clean install) with the testcase1 from comment 22. I attached 2 screenshot with testcase1 when font is active and another one with font inactive(I used Font Inspector - Developer Tools). I noticed that if arialbd and bradybun are inactive the bug is not reproducible(I attached a screenshot with the fonts). Since the issue is still reproducible and the information was added, I will reopen this bug.

Attached image fontsactive.png
Attached image fontsinactive.png
Attached image fontstobeinactive.png
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Flags: needinfo?(dholbert)

Thanks, Ralu! In the Font inspector's "ABC" preview of Arial text at the bottom-right of the affected screenshot (attachment 9297395 [details]), the text looks very suspiciously not-Arial...

Flags: needinfo?(dholbert)
Attachment #9282860 - Attachment description: testcase 1 (maybe?) → testcase 1
Attachment #9282862 - Attachment is obsolete: true

Actually that Arial preview-text looks like it is in fact showing "Brady Bunch" (bradybun.ttf), one of the two fonts that you screenshotted in comment 33.

Do you know where the those two TTF files from comment 33 came from? (And where do they live on your system?) Your screenshot shows them in "Font Pack", but I'm not sure what that actually corresponds to.

FWIW FontBase's Google pack (3795 fonts) doesn't give me any results for "arial" or "brady" (using FontBase's own search mechanism), so it doesn't look like they're included in that FontBase-provided set on my end at least...

Flags: needinfo?(raluca.popovici)

(It looks like the FontBase fonts themselves get downloaded to $HOME/FontBase/Providers/Google, and I don't see arialbd.ttf or bradybun.ttf listed there on my system.)

I will attach here the Font pack used on my TC. You should unzip it and add the folder to FontBase. Those 2 TFF files are displayed on the Font pack folder (I search for arial and that was my result). Maybe the issue is reproducible only with the Font Pack from my TC.

Flags: needinfo?(raluca.popovici)

This file (25.9 MB) is larger than the maximum allowed size (10.0 MB). Please consider uploading it to an online file storage and sharing the link in a bug comment instead.

Here is the link to download the Font pack: https://drive.google.com/open?id=1L29YfzkkgtG5dnScfT797whhMCceCHDq

Thanks. I can reproduce the bug with just the two fonts that you referenced (arialbd and bradybun) manually added in FontBase (after quitting & restarting Firefox for good measure; not sure if that's strictly necessary).

Also, if I just manually install those two fonts in Ubuntu (in a VM) e.g. by double-clicking them and then clicking "Install", then all Arial text (e.g. Google search results and the attached "testcase 1") simply gets rendered in Brady Bunch (though not overlapping), in Firefox as well as Chrome.

So I suspect Brady Bunch claims to be an Arial font, and on macOS we get confused about which Arial-family-font's glyphs vs. metrics to use, or something like that.

(In reply to Daniel Holbert [:dholbert] from comment #39)

So I suspect Brady Bunch claims to be an Arial font

(Confirmed, I think: ttfdump bradybun.ttf gives me this as part of the output:

Name table   1.	 PlatformID:	 1
		 EncodingID:	 0
		 LanguageID:	 0
		 NameID:	 1
		 Length:	 5
		 Offset:	 127
		 41 72 69 61 6c                 > Arial
[...]
Name table   4.	 PlatformID:	 1
		 EncodingID:	 0
		 LanguageID:	 0
		 NameID:	 4
		 Length:	 5
		 Offset:	 183
		 41 72 69 61 6c                 > Arial
[...]
Name table   6.	 PlatformID:	 1
		 EncodingID:	 0
		 LanguageID:	 0
		 NameID:	 6
		 Length:	 7
		 Offset:	 206
		 41 72 69 61 6c 4d 54           > ArialMT
Summary: Text overlapping when FontBase is used on macOS → Text overlapping when FontBase is used on macOS to activate "Brady Bunch" and "Arial Bold"

Actually, I can reproduce this with just Brady Bunch activated in FontBase (I don't need "Arial Bold" to be activated).

Also, if I double-click bradybun.ttf and click through to just install it on my mac, MacOS "Font Validation" tells me:

2 minor problems were found. Proceed with caution.
1 serious error was found. Do not use this font file.

It looks like the "serious error" is 'post' table usability and the minor problems are 'name' table structure and 'name' table usability.

I'm a bit out of my depth with font file handling at this point, but I suspect this font may just be ~broken. jfkthame, any further insights or thoughts on what we might be able to do, to mitigate this issue for users who happen to have this font installed?

Flags: needinfo?(jfkthame)

One more note... On macOS, if I activate arialbd.ttf and bradybun.ttf fonts in FontBase, and then launch Chrome, then Chrome to renders all Arial text (e.g. the attached testcase 1) using the Brady Bunch font, just like Firefox/Chrome do on Ubuntu as noted in comment 39.

So the Firefox-on-mac specific issue here seems to be that Firefox-on-Mac is "failing" to render text with that Brady Bunch font, and is instead using actual Arial characters with Brady Bunch metrics (I think?)

And if I start macOS Nightly with MOZ_LOG="fontlist:5", I get this logging in the "bad" scenario, at the moment I load testcase 1:

[Child 2346: Main Thread]: D/fontlist (fontlist-cmap) name: ArialMT, size: 320 hash: 00000000 new

vs. this logging in a "normal" scenario if I start Firefox Nightly with no fonts activated in FontBase and load testcase 1:

[Child 2226: Main Thread]: D/fontlist (fontlist-cmap) name: ArialMT, size: 1824 hash: 00000000 new

(Note the "size" difference.)

The fontlist logging before that point is all identical between bad/good conditions, which is interesting.

Yeah, this font file is clearly a badly-made hack. It identifies itself as Arial, but is not compatible with the real Arial font. In particular, the PSName (name ID 6) is used by MacOS font APIs as a key identifier for font resources, and this file duplicates the system Arial's name, so it's anyone's guess what a function like CGFontCreateWithFontName will return.

What I think is happening here is that the content process is getting one font resource when it asks for "ArialMT", and performs text shaping and layout using that font's glyph IDs and metrics. Then it hands the array of glyph IDs and positions to the rendering process, but when that process asks for "ArialMT" it's getting the other, incompatible resource.

It would be nice if we could figure out how to ensure that all Firefox processes reliably get the same font resources when things like this happen, but I'm not sure how to do that; we get fonts by querying the OS, and if there are duplicates like this present, there doesn't appear to be any way for us to control what it'll give us.

In short: this bradybun.ttf is a broken hack. Most likely, someone took a copy of Arial, and modified the glyphs in it, leaving the "shell" of the font file -- in particular, its naming information -- unchanged (which was probably a licensing violation, incidentally). It should be removed from any reputable font libraries that are distributing it. (It doesn't appear to be in Google Fonts, for instance.)

(BTW, I tried searching for the font online, but the version I found must be a newer revision, and identified itself as "BradyBunchRemastered". The original source may have been http://moorstation.org/typoasis/designers/insanitype/index.htm, but that site seems abandoned and hacked: its download link instead goes to a casino site.)

Flags: needinfo?(jfkthame)

Hah, looking at the bradybun.ttf from the archive in comment 38, it's actually quite broken. The <name> table indicates that this was originally Monotype Arial from the MS Core Fonts collection:

    <namerecord nameID="0" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Typeface © The Monotype Corporation plc. Data © The Monotype Corporation plc/Type Solutions Inc. 1990-1992. All Rights Reserved
    </namerecord>
    <namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Arial
    </namerecord>
    <namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Regular
    </namerecord>
    <namerecord nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Monotype:Arial Regular:Version 2 (Microsoft)
    </namerecord>
    <namerecord nameID="4" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Arial
    </namerecord>
    <namerecord nameID="5" platformID="1" platEncID="0" langID="0x0" unicode="True">
      MS core font:V2.00
    </namerecord>
    <namerecord nameID="6" platformID="1" platEncID="0" langID="0x0" unicode="True">
      ArialMT
    </namerecord>
    <namerecord nameID="7" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Arial® Trademark of The Monotype Corporation plc registered in the US Pat &amp; TM Off. and elsewhere.
    </namerecord>

but the glyphs have obviously been replaced, and some of the names have been changed:

    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      http://members.aol.com/InterNuT85  © 1998 Adam Nerland
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Brady Bunch
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      Softy v. 1.07  Brady Bunch
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Brady Bunch
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Softy v. 1.07 5/24 - 5/25/98
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Brady Bunch
    </namerecord>

So it identifies itself as both Arial and Brady Bunch, depending which name strings are used. And the Brady Bunch names are invalid: space is not allowed in the PSName (id 6). Also, the Apple TrueType specification explicitly requires that all PSName entries in the font must be identical.

Install broken fonts, get broken text.

We've had a few reports that seem to be this same underlying issue (the difference in font choice between different processes that jfkthame discussed in comment 44).

I filed bug 1803406 to cover this category of issues, as a "fresh start" with a rough up-front explanation (without all the whats-going-on investigation history that makes up most of this bug), and I'll dupe this bug and the related bugs there.

Status: REOPENED → RESOLVED
Closed: 2 years ago1 year ago
Duplicate of bug: 1803406
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: