If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Font settings are broken, can't force webpages to use the same font




CSS Parsing and Computation
7 years ago
7 days ago


(Reporter: avada, Unassigned)



Windows 7

Firefox Tracking Flags

(blocking2.0 -)




7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; hu; rv: Gecko/20100722 Firefox/3.6.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; hu; rv: Gecko/20100722 Firefox/3.6.8

When you disable the option to allow pages to use their own fonts not all pages will appear with your chosen font. Its very messy. Some of them will always have what you set for serif. Some will have a sans-serif or serif font based on what you select as proportional, but not the one you selected. And other weirdnesses.

Reproducible: Always

Steps to Reproduce:
1. Go to font settings / advanced
2. Disable the "Allow pages to use their own fonts, instead of the my selections above" option
3. Change proportional, serif, sans-serif settings.
Actual Results:  
Font settings are not followed correctly for a large part of the webpages. 

Expected Results:  
The pages use the selected font.

Forcing a font in usercontent.css will make webpages appear mostly with the same font. But then I found some text on the same website appear with a different font.
Talked about it more in this mozillazine topic: http://forums.mozillazine.org/viewtopic.php?f=38&t=1963013
Tried it with the 3.6 branch and 4.0 nightlies, with new profiles.


7 years ago
blocking2.0: --- → ?
Keywords: fonts


7 years ago
Version: unspecified → Trunk
--> Core
Component: General → Layout: Text
Product: Firefox → Core
QA Contact: general → layout.fonts-and-text
Component: Layout: Text → Style System (CSS)
QA Contact: layout.fonts-and-text → style-system
I believe the option is intended to continue to allow Web pages to choose serif, sans-serif, monospace, cursive, and fantasy font families.  Are you seeing something other than that?

Comment 3

7 years ago
I'm not sure what you mean David. If I tick the  "Allow pages to use their own fonts, instead of the my selections above" option then the pages use their own fonts. If I untick it I get the mess I tried to describe in my first post and the forum. What would be the point of this option if web pages would use their own fonts whether or not it is enabled? Also often the fonts change to some poorly readable font which is definitely not the same as the one the website normally uses (or what I chose).
blocking2.0: ? → -

Comment 4

3 months ago
Still an issue in Firefox 54. Sometimes it depends whether I reach a page from elsewhere in the site (which means my fonts apply) or from Google (which means they don't).

Comment 5

3 months ago
And it's not Windows-specific.

Comment 6

3 months ago
(In reply to MarjaE from comment #4)

This is unlikely to ever get fixed. They just don't care.
I think the problem so far has mostly been inability to reproduce.  A link to a specific page that shows the problem would be a good start, for example...

Comment 8

3 months ago
For me, this link works with my font settings:


But the link from this google search first loads with my font settings, then flashes and switches to the site's font settings:

OK, so just to make sure, here are the steps I just tried:

1)  Start Firefox 54 with a clean profile.
2)  Preferences > Content > Advanced button in the Fonts section,
    uncheck "Allow pages to choose their own fonts", click "OK".
3)  Open a new window, load http://salicylatesensitivity.com/forum/comments.php?DiscussionID=3182&page=1
4)  Open a new tab in the same window, load 
    and click the first search result, which loads the same page as in step 3.
5)  Switch back and forth between the tabs from step 3 and step 4 a few times
    with Ctrl+PgUp/Ctrl+PgDown and they look exactly identical.
6)  Go back to the preferences window, open the Advanced dialog again and re-check the
    "Allow pages..." checkbox, while keeping the window from step 3 visible; observe that
    the fonts change when clicking "OK".

In case this matters, this is on Mac.

Just to check, if you try to reproduce with a clean profile, do you still see the problem as described in comment 8?  If not, we should try to figure out what it is about your current profile that triggers the problem.  If you do see it in a clean profile with Firefox 54, then we'll need to dig some more to figure out why you and I are seeing different things...

Comment 10

3 months ago
I can't use a clean profile with my photosensitivity.
OK.  Well, some questions then.  Does the profile in question have any extensions installed?  If so, is it possible to try disabling them and seeing whether that affects the behavior?

Are there any obvious preferences I should be setting to try to match your setup?  Presumably the font pref (browser.display.use_document_fonts set to false), but what else?  The preference to override page colors, possibly, given comment 10?

For what it's worth, I've gone through the code dealing with this preference.  It's actually pretty simple.  It's read when setting up a new presentation (just like preferences for link color, text color, background), stored in a boolean member.  What that member does is a bit complicated, but it really shouldn't depend on how the page was navigated to.... 

I guess if the content of the page itself depends on how it was navigated to, _and_ the selected fonts don't have glyphs for some of the characters that appear on the page you could get fallback to some other font that does have glyphs for them, but generally just for those characters...

All of which is why I'd really like to figure out how to reproduce this.

Comment 12

a month ago
"Does the profile in question have any extensions installed?"


"If so, is it possible to try disabling them and seeing whether that affects the behavior?"

Not really.

I can't see what would affect this, but I have 3 about:config fixes, 7 extensions, and 10 user styles to block flashing and animation, plus a few others for other purposes.
OK.  Again, I'n happy to try to reproduce your setup locally, but I'll need more information than just the number of preferences and extensions and user styles; I'd need the actual preference names/values, the names of the extensions, the CSS from the user styles.

Comment 14

8 days ago
Another site with this bug:


Forcing it into Reader View does force it into OpenDyslexic.

I have rsi, and it's a lot to type up. I am currently using Firefox 52 esr, because 57 would make it much harder to protect myself. I use OpenDyslexic as a readable font.

About:Config fixes:
ui.caretBlinkTime 0
image.animation_mode none
can't remember which other about:config changes are through regular settings or not.

Activate Reader View
Configuration Mania
Copy Plain Text 2
Gothic font converter
Kill Button
Manage Folders
No Small Text
NoRedirect (some sites would redirect back and forth, and strobe because of it)
Open Bookmarks in New Tab
Open in Reader View
Refresh Blocker
Show my Password (coordination issues lead to mis-typing)
Show Parent Folder
Translate This!
Tumblr Savior
uBlock Origin

User Scripts affecting these pages:
None of them - they're all aimed at other sites

User Styles affecting these pages:
None of them - they're all aimed at other sites

User Styles affecting all of Firefox:
Block Loading Painimation

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

.tab-throbber { display:none!important; }

Comment 15

8 days ago
I think I've diagnosed the problem on my end. Not sure if this is the same problem as on the original poster's. Although the majority of the page is in English with the Roman alphabet, it was following font settings for the Cyrillic alphabet.
Thank you for digging into this more!

> it was following font settings for the Cyrillic alphabet.

This is for http://napolun.com/mirror/napoleonistyka.atspace.com/cavalry_tactics.html I assume?

If you can still reproduce this problem, what is the result of evaluting "document.charset" in the console on that page for you?

This page doesn't specify any language or character encoding information, as far as I can tell, so it might end up being rendered with a Cyrillic charset depending on how it gets loaded, which might affect which fonts get used...

Comment 17

8 days ago
For the napoleonistyka: x-mac-cyrillic

For the salicylate sensitivity: IBM866 if opened through Google, UTF-8 if opened by direct link.
> For the napoleonistyka: x-mac-cyrillic

Is it possible that this is the default encoding set in your preferences (e.g. you're using a localization of Firefox into some language that is written in Cyrillic)?

> For the salicylate sensitivity: IBM866 if opened through Google, UTF-8 if opened by direct link.

"IBM866" is also a Cyrillic encoding, ok.  The salicylate sensitivity page also has no encoding information.  I see it come up as UTF-8 when loaded directly and "windows-1252" when loaded via Google...

OK, so I just tried the Russian localization of Firefox.  In that, when I load http://napolun.com/mirror/napoleonistyka.atspace.com/cavalry_tactics.html it loads as "x-mac-cyrillic" (as opposed to "windows-1252" in the US/English localization).  When I load http://salicylatesensitivity.com/forum/comments.php?DiscussionID=3182&page=1 directly it does come up as UTF-8.  When I load it via the Google search results, I get "IBM866" as you do.  Oh, and Firefox gives a console warning on that page when loaded via Google:

"HTML-документ не содержит объявления кодировки символов. Если документ содержит символы, не входящие в диапазон US-ASCII, то в некоторых конфигурациях браузера в документе будет отображён искажённый текст. Кодировка символов страницы должна быть объявлена в документе или в протоколе передачи."

OK, so now we understand why you were not seeing your font settings applied to these pages; presumably they were not set for Cyrillic in preferences, and you're using a Cyrillic localization of Firefox.

The remaining question I had was why one page ended up as "IBM866" while the other ended up as "x-mac-cyrillic" and why you see the salicylate page flash from one charset to another, apparently.

The flashing made me think the issue might be charset autodetection, which is only enabled in the Japanese, Russian, and Ukrainian localizations.  And indeed, if I just set the "intl.charset.detector" preference to "ruprob" (the value in the Russian localization), I reproduce the "x-mac-cyrillic" and "IBM866" results.  Same thing if I set it to "ukprob" (the value in the Ukrainian localization).  That's because both pages contain some non-ASCII characters, and the autodetector tries to do its best to guess an encoding given that.

I don't know for sure why the autodetector doesn't kick in when "http://salicylatesensitivity.com/forum/comments.php?DiscussionID=3182" is loaded directly from the URL bar.  I could step through it in a debugger, but the autodetection heuristics are rather complicated, and in the end just that: heuristics.  :(

I also don't know whether the original; reporter's problem is different font settings for different language groups.  avada, could you please check that?
Flags: needinfo?(dqeswn)

Comment 19

8 days ago
I opened this seven years ago... Don't remember everything. Though I'm quite sure it's not related to non-roman text. I just simply didn't have the set fonts on all pages. I don't normally visit websites with non-roman characters/languages. And when I do so I do it in chrome because it has a usable built in webpage translator.

As for the original bug, I doubt anything changed. Though I don't use this firefox feature anymore, so I don't know which websites would appear how. I started overriding website fonts via CSS not long after filing this to no avail. (Which I also stopped doing because stupid websites started using fonts as icons sot they got broken)
Flags: needinfo?(dqeswn)

Comment 20

8 days ago
-- and you're using a Cyrillic localization of Firefox.

But I'm not.
> Though I'm quite sure it's not related to non-roman text.

There's no non-roman text involved in the pages MarjaE pointed to.  There's just non-ASCII text.  And some of it isn't even user-visible (e.g. <img> alt attributes).

> But I'm not.

OK.  What value do you have for the "intl.charset.detector" preference in about:config?
Flags: needinfo?(erwinm)

Comment 22

7 days ago
Somehow it got switched to ukprob. I'm not sure how or when or why.
Flags: needinfo?(erwinm)
OK.  Is it showing up as a default value (not bolded) or as a user-set value (bolded)?

If the latter, it's possible that some extension set it...  In that case, resetting to default will at least stop the autodetector from triggering for you.  If it's set as a default value, you can obviously still set it to empty string manually, but I'd want to try to figure out how you ended up in that state.

Comment 24

7 days ago
User set. Probably from View > Text Encoding > Auto-Detect, because I'd encountered problems with certain pages turning up gibberish.
You need to log in before you can comment on or make changes to this bug.