Closed njt1968 closed 1 year ago
Hi!
You can use the offset_x
and offset_y
properties. For some reason the font gets vertically offset randomly depending on the font during SDF generation. I think I'm likely not positioning it correctly on the Y axis. In any case I added the additional properties to work as a workaround.
Which version of Kayak are you using? I made some changes to adjust the sampling curve for the SDF lookup to avoid the white boxes around the characters in the latest 0.2 release, and it's a bit surprising for you to have them.
Update to latest version did fix the visual noise, and after manually adjusting the Y offset, everything working fine. Thanks for your help 😊
Update:
On latest version, when using .kttf, the font looks fine on the .exe and when compiled to WASM on mobile browser, but not on Chrome/Edge on Windows.
.EXE:
Mobile (via WASM):
Chrome (via WASM):
Any clue whats happening here? Wish I had more info to debug with but I am lost here
I also get some vertical offset weirdness happening with .kttf. Happening on windows and firefox at least:
kttf:
kayak_font:
I also get some vertical offset weirdness happening with .kttf. Happening on windows and firefox at least:
kttf:
kayak_font:
This happens because the positioning in the font sdf generation is wrong. It seems to be different per font. I did add an offset_x and offset_y as a work around until I can fix it.
Any clue whats happening here? Wish I had more info to debug with but I am lost here
I'm not sure I'll try to take a look soon.
I'm getting the same visual noise on kttf fonts, and it seems to be related to the font size somehow.
The default roboto font from this repo with size
set to 20.0 in the TextProps
The same font with size
set to 15.0
This happens for me in both wasm on firefox and native on Fedora Linux under Wayland
I also have the white stripes issue only on some font sizes:
It's consistent across firefox, chrome and native windows. It only seems to happen on non-hidpi screens.
Can you see if this PR fixes things? https://github.com/StarArawn/kayak_ui/pull/221
Trying to switch from .kayak_font to .kttf for WASM purposes, but it made some visual glitchiness:
.kayak_font:
.kttf:
The kttf code:
Help appreciated 🤪