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
Fonts: cannot upload custom font that exists in Google Fonts #13621
Comments
A filter to simply disable Google Fonts altogether breaks a lot of things, such as the Getting Started story and text presets ( A POC for allowing custom fonts with the same name as a Google font would probably look like this:
Questions:
Testing scenarios: a) New story
b) Existing story
AlternativesAutomatically host fonts locally Instead of doing this, we could instead just automatically download the Google Fonts to the server (e.g. to Main question is: (how) are fonts deleted again? And if a remote font is updated, how do we update it on the server? This could be done like this:
This was previously raised in #12597. Recommend a third-party plugin for local-hosted Google FOnts In the past I tested an existing WordPress plugin for doing the above, but it didn't quite work with the Web Stories plugin. Maybe if we could find a working plugin, we can simply recommend using that instead. Edit: it was Dan0sz/host-webfonts-locally#2 cc @Swanand01 for thoughts |
Hi, I looked for and found a few plugins that allowed hosting Google fonts locally, but I wanted to know what exactly we expect from these plugins. How would this solve the problem of the user not being able to upload a custom font? |
In this reported use case, the user wanted to upload a custom Roboto font to avoid loading it externally from Google Fonts. If they can use a plugin that automatically downloads Google Fonts and serves them locally, that would address their need without having to upload a custom font. In other words: User need: do not load Roboto font from external service Does that make sense? |
Got it, thanks a lot for the explanation! |
Have you tried it already and does it work for stories? |
Tested it for a variety of fonts, but it was able to serve only a few of those locally. I tested this plugin with a variety of fonts across multiple stories, and it was able to serve all the fonts locally. |
Awesome, that is excellent, thanks for testing @Swanand01! |
Bug Description
Originally reported at #11305 (comment)
When going to Stories -> Settings -> Custom Fonts and uploading a font, we check whether the font already exists—either as a custom font, system font, or Google Font. The reason is that we want to prevent duplicate entries in the fonts dropdown, as that would lead to weird UX.
That means one cannot upload a custom Roboto font, as that already exists in the Google Fonts list.
Expected Behaviour
One should probably be able to use custom fonts in favor of remote hosted Google Fonts.
Question is how we best solve that.
We could provide a filter as described in #11305, or just make custom fonts take precedence over Google Fonts. But then how does that affect existing stories?
Steps to Reproduce
Screenshots
Additional Context
The text was updated successfully, but these errors were encountered: