-
-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord fonts are blocked by CORS policy #322
Comments
I'm personally completely OK with the Helvetica fallback - it's quite close, and in my opinion doesn't detract from the "integrity" of an export. I wouldn't wish to see the minimum size of a backup become so inflated. That said, I think the best solution would be to exclude all fonts by default, with an optional flag to embed the full font set. Thanks again for this software, and for maintaining it! |
Helvetica it is then! |
JSDelivr could be used as a cdn for the fonts, just put them in a github repo. |
@shirtjs hm, I didn't know it was as simple as that. I'll check that out, thanks! |
Recently Discord decided to finally enable CORS policy on their CDN which prevents Whitney fonts from loading in HTML exports:
There are a couple of ways to deal with this but each comes with certain drawbacks:
Embed fonts directly in the export file. This would mean that the fonts are going to be part of the page, which pushes the minimum size of the export file up to ~500kb since the fonts are quite large.
Embed only one font directly in the export file. Instead of using all fonts, we can only use the most common one (Whitney Regular, which is used for text content) and extrapolate the others with font weight. This pushes the minimum size to ~100kb.
Host the fonts on another CDN that allows any CORS origin. This would fix the problem, but someone will have to care of the hosting and it won't be me.
Leave things as they are. That means the fonts will likely not work on modern browsers, unless you launch them with special settings that ignore CORS for locally stored files or use extensions that help with that on per-page basis. In worst case scenario, Whitney fonts are automatically replaced with Helvetica variants which are similar-ish but will still look different than original Discord fonts.
This thread is open for discussions, votes, and suggestions.
The text was updated successfully, but these errors were encountered: