kayak_ui icon indicating copy to clipboard operation
kayak_ui copied to clipboard

Font rendering on wasm/web?

Open ChristopherBiscardi opened this issue 3 years ago • 6 comments

Heya!

Is kayak's font rendering supposed to work on wasm? Everything else seems to work (ninepatch, on_event, styles, etc), but the fonts aren't rendering at all in the wasm port of my game. I also don't see any errors in the console and such.

The buttons here should have some text on them.

image

ChristopherBiscardi avatar Apr 27 '22 18:04 ChristopherBiscardi

Yes! This is a known issue. It's due to a bug in wGPU which prevents us from creating a texture array in webGL 2. Even though it is possible.

StarArawn avatar Apr 27 '22 18:04 StarArawn

Hm. Did you set your font default in the FontMapping resource?

Edit: Didn't see Star's comment. Disregard this one haha.

MrGVSV avatar Apr 27 '22 18:04 MrGVSV

Is that this issue? https://github.com/gfx-rs/wgpu/issues/2161

ChristopherBiscardi avatar Apr 27 '22 19:04 ChristopherBiscardi

Is that this issue? gfx-rs/wgpu#2161

No, I worked around that by avoiding numbers divisible by 6. I was working on tracking it down so I could provide an actual error to the WGPU team, but I got sidetracked. The issue occurs because of the copy_texture_to_texture wgpu command I'm using to copy data from an atlas to an array texture.

StarArawn avatar Apr 27 '22 19:04 StarArawn

No, I worked around that by avoiding numbers divisible by 6.

😳

MrGVSV avatar Apr 27 '22 19:04 MrGVSV

This might be more fixable as of bevy 0.8.

StarArawn avatar Aug 18 '22 16:08 StarArawn

This is now fixed when using TTF fonts directly! Take a look at the clipping example or the book to learn more. 👍

StarArawn avatar Nov 26 '22 14:11 StarArawn