5 ms·
In Firefox, you can the advanced font settings and uncheck “Allow pages to choose their own fonts, instead of your selections above” to force websites to use th
by claytonwramsey 2y ago
In Firefox, you can the advanced font settings and uncheck “Allow pages to choose their own fonts, instead of your selections above” to force websites to use the default font.
- _heimdall 2y agoDoes this break icon fonts, or will icon fonts still display since the font you choose wouldn't have those ligatures defined?
- masfuerte 2y agoAn icon font ligature is just an entry in the font file that says to display a particular sequence of characters as a single glyph. In the absence of the font the browser doesn't know that the page designer (or the font designer) intended a ligature. If you force an alternative font the browser will just display the sequence of characters that made up the ligature. A few ligatures do have their own unicode code points, e.g. ffi, so the browser knows what is intended independent of the font. The ligatures used by icon fonts do not have their own code points.
- duskwuff 2y ago> An icon font ligature is just an entry in the font file that says to display a particular sequence of characters as a single glyph. Most icon fonts use private-use codepoints, not ligatures. These codepoints have no standard glyph, so disabling site-specific fonts will make those characters fail to render at all or display placeholder characters (e.g. �). Thankfully, icon fonts are declining rapidly in usage - SVG icons are superior for most use cases. > A few ligatures do have their own unicode code points, e.g. ffi, so the browser knows what is intended. The precomposed ligature codepoints (e.g. U+FB00-FB06) only exist for compatibility with legacy encodings which included similar characters. They shouldn't be used in new documents. If you want text on a web page to use ligatures, use the CSS font-variant-ligatures property to control which ones are used. (And make sure to disable them on monospaced text!)
- _heimdall 2y agoIts interesting that Firefox would offer a feature that disables all custom fonts rather than simply prioritizing the user's preferred font. It does add a bit of performance gain not loading the fonts, and it may be a small security improvement, but if the goal was usability/readability that seems like a huge miss.
- hnlmorg 2y agoA preference based system would be almost impossible to maintain considering the literal infinite number of type faces out there (thousands plus more built every week). Add to that, this feature also needs to be understandable for non-technical people who might never have view a page source in their lives. Much as a granular system would be more powerful and preferable for the HN community, having a dumb toggle makes a lot more sense from Firefox’s perspective.
- _heimdall 2y agoI wasn't thinking granular control. It could work exactly like the existing preference with users picking a preferred font. That font is always set as the highest priority font and used for any characters it supports, but the page's custom fonts are still fallbacks and kept in the font stack for any characters missing from the user font. This would be helpful for icon fonts, but also for user preferred fonts that don't cover all language character sets.
- hnlmorg 2y agoOh I see. Is that not how it works already? Apologies if I’ve completely misunderstood your comments
- _heimdall 2y agoNo problem at all! I haven't been by my desktop the last couple days but I do want to test it. I hope that's already how it works, that would make more sense to me than blocking all custom font loading (though that does have its purposes).
- lelele 2y agoYes, it does break icon fonts.