Open Bug 1920340 Opened 1 year ago Updated 1 year ago

userChrome.css font not working on startup/session restore

Categories

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

Firefox 130
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mozsupport2019, Unassigned, NeedInfo)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

adapt a working userChrome.css from Ubuntu Linux for use on Windows.
It includes font override for much of the GUI, and in particular for tab labels
The style is
font-family: "Liberation Sans Narrow","PT Sans Narrow","Bahnschrift Light Condensed",Calibri !important;
(all listed fonts are installed - can be picked e.g. in Wordpad)

Actual results:

The windows that are created by session restore when starting firefox use a system font (Calibri) instead of the preferred font.
When opening another window with Ctrl-N, that new window uses the preferred font.
(Note when I use the Browser Toolbox on the initial window, it underlines Calibri in the font list. When I use it on a newly opened window where it uses my preferred font, it does not.)

Expected results:

The preferred font should be used consistently in all Firefox windows.

I attached my userChrome.css in case it helps in reproducing the issue.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

The severity field is not set for this bug.
:jfkthame, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jfkthame)

I see a number of issues with userChrome.css menu fonts that are still present in the latest Firefox v132.0b9 Developer Edition.

I used to just follow this: https://support.mozilla.org/si/questions/1335097

So userChrome.css would have:

#navigator-toolbox { font-family:OCR A Extended !important }

...but that no longer works.

I had to switch it to:

menu, menupopup :is(menu, menuitem), .subviewbutton {
font-family: "OCR A Extended" !important;
}

...but that produces what sounds to me is similar to the font issue that the original poster mentioned. On my Windows 10 system it's some weird small serif font that I'm unable to identify. But it works however if I leave the "Extended" off:

menu, menupopup :is(menu, menuitem), .subviewbutton {
font-family: "OCR A" !important;
}

The name of the font is "OCR A Extended" on my Windows 10 system.

Another issue is that the above only works if it is at the very top of userChrome.css, immediately after the @namespace url line at the top (it can have blank spaces after). If I type any lines, even a comment line like /* Menu fonts above it, then it doesn't work.

See:

https://support.mozilla.org/si/questions/1469572

Let's keep this focused on the issue from comment 0 -- specifcally, userChrome.css-specified fonts not working in sessionrestored windows, but working just fine in subsequently-opened windows. (Jacob, you may want to spin off a separate bug for comment 5, if you don't mind.)

I'm guessing the explanation here might be the cross-process shared font list -- bug 1533462 -- which, if I recall correctly, asynchronously loads the list of available fonts in the background (while Firefox is running). In theory, it can take an arbitrary amount of time, depending on how long it takes to get the list of fonts (based on e.g. disk I/O speed). Until it completes, I think (?) we assume the system fonts are all available, but we don't know anything about other fonts beyond that.

Once the shared font list has completed, we immediately force web content to re-render (so it can pick up the proper fonts that are now maybe available), but maybe that doesn't work for the parent (Firefox-frontend) process or something?

(Note: On my system, I haven't yet been able to reproduce this bug (with userChrome.css pointing at a freshly-installed downloaded font) -- my font loads just fine in tab-titles in a sessionrestored window. But that might be because my disk I/O is quite fast; I'm using got a fairly new machine with NVME SSD).

jfkthame might have more thoughts about explanations here, when he has cycles to take a look.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: