forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Preload fonts before rerendering wizard style canvas (discourse#…
…22361) ]When changing fonts in the `/wizard/steps/styling` step of the wizard, users would not see the font loaded straight away, having to switch to another one then back to the original to see the result. This is because we are using canvas to render the style preview and this fails with a Chrome-based intervention when font loading is taking too long: > [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://sea2.discourse-cdn.com/business7/fonts/Roboto-Bold.ttf?v=0.0.9 We can get around this by manually loading the fonts selected using the FontFace JS API when the user selects them and before rerendering the canvas. This just requires preloading more information about the fonts if the user is admin so the wizard can query this data.
- Loading branch information
1 parent
821cf20
commit db80a8c
Showing
4 changed files
with
171 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters