sbrin / lopaka

Lopaka - Stunning graphics for embedded systems displays
https://lopaka.app
Apache License 2.0
367 stars 19 forks source link

Incorrect displaying of string layer #1

Closed hermanguilliman closed 1 year ago

hermanguilliman commented 1 year ago

I have a problem with String layer. Used Windows 10 x64, Google Chrome 114, Opera 99.0, Edge 114. Anyway only Firefox 113 works fine string

Mel0ne commented 1 year ago

Confirm same problem on Brave 1.52.122 (Chromium: 114.0.5735.110)

Brave-Racoon commented 1 year ago

Similar bug on Brave Version 1.47.186 Chromium: 109.0.5414.119 (Official Build) (64-bit). Works fine on Tor Browser 12.0.6.

Manucv20 commented 1 year ago

i have the same issue

sbrin commented 1 year ago

Thank you for reporting. Does it help to refresh the page? Do you see any related errors in browser dev tools? Does it help to switch fonts back and forth?

hermanguilliman commented 1 year ago

Thank you for reporting. Does it help to refresh the page? Do you see any related errors in browser dev tools? Does it help to switch fonts back and forth?

Only these image

jamisonderek commented 1 year ago

For my computer, when I edit js/utils.js to have the maskBlack function use imgData.data[i + 3] > 150 instead of imgData.data[i + 3] === 255 then it works fine in both Windows 11 Edge and Windows 11 Chrome 115.0.5789.102.

If I increase the value to 170, then it still works in Edge but renders lines in Chrome for the haxr font. At a value of 180 then I also get lines in Edge for haxr font. At 200 then even the helvB font no longer renders correctly.

I'm not clear if using imgData.data[i + 3]>150 would pull in additional artifacts on working browsers, so maybe you have to do browser detection to determine the best value for the user?

sbrin commented 1 year ago

@jamisonderek thank you for pointing to masking function, I didn't expect it can ruin the text display. I've pushed some updates including layers rendering logic. Please check it out.

Racso commented 1 year ago

Hi. I just got this issue.

Neither refreshing or switching fonts help.

image

Racso commented 1 year ago

I can confirm that @jamisonderek's change fixes the issue. I set utils.js:125 to:

imgData.data[i + 3] > 150

and strings get correctly masked into the screen.

Running Chrome 115.0.5790.110 in Windows 10.

sbrin commented 1 year ago

@Racso thanks for sharing

I did some updates recently. Could you please check the latest code version?

Racso commented 1 year ago

It's way better! The tool is perfectly usable now. Thanks!

image

I'm not sure if it's intended or not, but there is some slight "shadowing" around the letters.

image

sbrin commented 1 year ago

I'm not sure if it's intended or not, but there is some slight "shadowing" around the letters.

It is not intended. Probably windows has some different font rendering rules. Will explore that later. Thank you!