-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Tour (WASM): No text rendered #1974
Comments
I think that "Tour (WASM)" is a reference to https://github.com/iced-rs/iced/blob/master/examples/README.md#tour Now let's see what will be here first:
|
It is the tour example: https://github.com/iced-rs/iced/tree/master/examples/tour |
I can reproduce the issue with an unmodified version (in As said in #1975, it works in the @jalil-salame please verify if your experiment with |
WASM (tour example)
Downloading a monospace font and using it to style elements works in 0.9. The default font works too. I did not modify the tour example. I had a label which I wanted to be monospace so I tried switching to the master branch. When I saw that no text was being rendered. I tested the tour example unmodified. |
Below "screenshot" of my
is odd. ( Sorry for not explaining why I think it is odd.)
|
It might be related to pop-os/cosmic-text#148, looking at the trace of another application, |
First bad commit: b9a9576 (yes, that was a large commit) |
In b9a9576#diff-c981d265dedee6ce4893e68123eeb73e3e5c07aa65dfde6e8f3e2966da0e63dc a lot of font-related things get deleted |
its because WASM doesn't load fonts as the browser doesn't allow access to them through the font systems. So you must load them manually if you use WASM. the old font system would Preload these itself as there were only a few fonts. now we auto load all the fonts in the system font folder. just we can not do this for WASM. WASM is 3rd class support here. |
why aren't we just using native canvas text rendering functions? it will fix some issues, reduce size a lot and increase performance |
you would need to be able to implement it in such a way that would allow both to exist as WASM is not the only way this is compiled. Having 2 separate instances also makes maintainability harder. Also the Canvas 2d you still need to tell it what Font to set or it will use a Default Font that the browser will always support off the bat. Also this would be a completely different rendering system then as well. Hector Could include some preloaded WASM Fonts to use as Defaults. this would help some. |
Possible way to get it working: add function to load font from file. On desktop app it reads the file from fs or include it in binary, and on web it adds <style> loading that font. Then on native use apis used currently and on web native canvas functions. |
I'd say that Iced-Web is basically unusable at this point. Last time I saw Iced Web working was in 2022. |
Is there a way to add render test for Iced-Web to CICD? |
Is there an existing issue for this?
Is this issue related to iced?
What happened?
I wanted to do
monospace
fonts for a text input, seeing that master hadiced::Font::MONOSPACE
I wanted to try it out. So I switched my project from0.9.0
tomaster
.Immediately all text was missing when using the wasm build.
I switched to the
tour
example on master and there all text is also missing.The text width seems to be calculated properly (buttons have different widths).
I tried it with
trunk serve
. Trying the same thing but targeting windows showed no visual issues in the tour.What is the expected behavior?
Fonts should be visible
Version
master
Operating System
Linux
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered: