-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow fetching font from URL on wasm #28
Comments
I worry this may be out of scope for the editor plugin, could be left as an exercise for the user? Then again it's your plugin, you know scope better than I ;) Bevy can already load from a local web location (assets folder next to .wasm I think?) with the normal AssetServer though because we load fonts as bytes I'm fairly sure we can use any GET request and use the result straight away. The concern is with adding dependencies to manage the web requests, and there's a lot of options for them. Simplest for Bevy seems to be https://github.com/TotalKrill/bevy_mod_reqwest , and from experience reqwest on it's own is pretty friendly. But adding deps will increase bin size somewhat. The next issue is one of timing. Web requests can take a long time, and I don't know what happens if we request to use a font that isn't loaded yet and load it to the fontdb later, will it un-fallback or does the editor need reconfiguring? And then there's async to think on too. Maybe when Assets V2 drops it might be an idea to work on all font loading, and the PR mentions internet loading. Sorry for rambling lol. I do think webfonts would be sweet, but wanna get the approach right. |
Yeah, I agree that it should be implemented upstream... like in |
If it's implemented upstream in an app that uses plugin - app may have just 2 states: |
Something like https://github.com/johanhelsing/bevy_web_asset/blob/main/src/web_asset_io.rs#L26
This will allow to use emoji fonts on wasm without bloating the binary size.
The text was updated successfully, but these errors were encountered: