News for hackers. Stuff that matters.
Re:Self-host your fonts for better performance by smt88 on Friday December 04, 2020 @05:41AM (#25300940)
Won't this break the UI of most sites because they (ab)use web fonts to add icons?

It's annoying to hit a page with a video player, and all the buttons are little boxes with numbers in them because the icon font didn't load...

Re:Self-host your fonts for better performance by jfk13 on Friday December 04, 2020 @06:47AM (#25301299)
It depends.

In Firefox, disabling "Allow pages to choose their own fonts" does not completely block web fonts (as setting gfx.downloadable_fonts.enabled to false would); what it does is to prioritise the default fonts, and move any page-specified fonts to the end of the fallback list.

This means that for "normal" text, the browser's default fonts will be used, but if there are Private Use Area character codes that are only supported by the site's custom webfont, it'll still get used for those. So icon fonts that are based on PUA code points will still work.

What doesn't work in this scenario is when the icon font doesn't encode its icons in the PUA, but uses normal Unicode characters -- either symbol code points that are supported by the system's default fonts, or as some icon fonts do, regular English words that then use ligature rules to produce the icon glyphs. (So the icon font contains OpenType mappings such as "phone" -> [phone icon].) In this case the content on the page will end up rendered using the default font instead.

[Edited: HN doesn't let me include an actual phone icon there, apparently.]

Re:Self-host your fonts for better performance by test1235 on Friday December 04, 2020 @05:58AM (#25301037)
for me personally, I've only noticed this problem once, but I can't remember which site that was (must be one I don't visit often), but obviously your browsing habits are different to mine.

I don't see any disadvantages to giving it a try yourself for a while tho' - it's just a single checkbox setting.

Re:Self-host your fonts for better performance by smt88 on Friday December 04, 2020 @08:01AM (#25301767)
I have tried it with uBlock (not Firefox's native setting), and it breaks a ton of mainstream sites.
Re:Self-host your fonts for better performance by danielheath on Friday December 04, 2020 @06:23AM (#25301166)
“No web fonts for elements containing multiple characters” would be a great ublock rule, now I think about it...
Re:Self-host your fonts for better performance by jfk13 on Friday December 04, 2020 @09:40AM (#25302665)
That'd break sites that use ligature-based icon fonts, with the actual content being an icon identifier like "thumbs-up" and an OpenType ligature rule in the font to render this as an icon glyph.
Re:Self-host your fonts for better performance by folmar on Friday December 04, 2020 @11:31AM (#25304212)
Could you just get the icon name in that case? For me it would be good-enough, or, in many cases, better than the crammed design-first icons (Slack, I'm pointing at you!).
Re:Self-host your fonts for better performance by jfk13 on Friday December 04, 2020 @04:37PM (#25308423)
In theory, it's legible; but often, rendering the icon name (which may be up to a dozen letters or so) will totally break a layout that was designed to accommodate a single glyph.
Re:Self-host your fonts for better performance by danielheath on Friday December 04, 2020 @08:56PM (#25310891)
Ahh good point. Not sure if I have seen one of those used before; they seem to have a good fallback though.
Re:Self-host your fonts for better performance by ori_b on Friday December 04, 2020 @09:40AM (#25302667)
Very few sites do this, in my experience.