Closed Bug 1260637 Opened 9 years ago Closed 7 years ago

Provide an API/pref to blacklist specific system fonts

Categories

(Core :: Graphics: Text, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: timdream, Unassigned)

Details

(Whiteboard: gfx-noted)

I got a add-on in place that would tweak the default font fallback for Chinese locales [1]. The propose of the add-on is to provide a consistent reading experience for Chinese characters, if the user is more comfortable reading them in glyph of their own locale than the locale of the website. In order to stop Chinese fonts from other locales from showing up, the add-on would have to do more than change the font fallback -- it would have to stop using these fonts even if the websites specifically set them in `font-family`. I don't think such pref/API exists internally in Gecko available, so I wonder if it make sense to provide one. The alternative would be remove the said fonts from the OS entirely, but it's often not possible in Windows and Mac OS X. User sometimes don't want to modify the system files too just for Firefox too. [1] https://github.com/timdream/zh-font-tweak :jdt and :jfkthame, what do you guys think? Do you agree with the feature proposed here? If so, I might be able to (or find someone to) work on a patch.
Flags: needinfo?(jfkthame)
Flags: needinfo?(jd.bugzilla)
There is another approach add-on could do -- inject a content script into _every_ page and modify it's CSS to remove blacklist fonts. But I won't go there if there are other options.
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #0) > it would have > to stop using these fonts even if the websites specifically set them in > `font-family`. That pretty much amounts to saying "use the fonts I prefer, ignoring what the author specified" for the Chinese text... we have a mechanism for that, actually, in a more global way. Just turn off the checkbox "Allow pages to choose their own fonts, instead of my selections above" in Preferences / Content / Fonts / Advanced. I'm not sure I'd be comfortable adding API or pref support to blacklist specific installed fonts; that seems like adding overhead (and maintenance burden) for an extremely "niche" case. It also sounds like it could lead to support headaches, if people start setting such a pref (because someone on a blog somewhere told them to), and forget about it.... and six months later, some site renders funky because it assumed a standard Windows font that's now being hidden. So, at this point I'm not keen. John, any opinions?
Flags: needinfo?(jfkthame)
(In reply to Jonathan Kew (:jfkthame) from comment #2) > That pretty much amounts to saying "use the fonts I prefer, ignoring what > the author specified" for the Chinese text... we have a mechanism for that, > actually, in a more global way. Just turn off the checkbox "Allow pages to > choose their own fonts, instead of my selections above" in Preferences / > Content / Fonts / Advanced. That's more of a white list than a black list. And the pref is not per-locales and applies globally. I don't want to see Heltevica all the time for Latin locales, for example. > I'm not sure I'd be comfortable adding API or pref support to blacklist > specific installed fonts; that seems like adding overhead (and maintenance > burden) for an extremely "niche" case. This add-on has users ~ 800, and the popular New Tong Wen Tang has the feature too (implemented by rewriting CSS rule upon load), so I won't say it's niche. I don't have the authority to talk about maintenance burden, though. > It also sounds like it could lead to > support headaches, if people start setting such a pref (because someone on a > blog somewhere told them to), and forget about it.... and six months later, > some site renders funky because it assumed a standard Windows font that's > now being hidden. Agreed the pref might introduce more support headaches, on top of the current `font.*` pref. Are the `font.*` pref already a support headache? I can see a few SUMO posts but I didn't dig deeper.
Whiteboard: gfx-noted
It no longer makes sense to add new pref for features since web ext has no access to it.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(jd.bugzilla)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.