Graphics.createCallback in Bangle.js 1 vs 2 | Vector Font | Font converter #5681
Replies: 1 comment
-
Posted at 2021-10-19 by @gfwilliams Hi, 1: Bangle.js 1 display can't be read back from - getPixel always returns 0 in Bangle 1, which is why you're seeing different values. You'd have to use an offscreen buffer. Also, I'm afraid using createCallback that way, while really neat, is going to be pretty slow on the actual device :( You could potentially do something different: Have 2x 1bpp ArrayBuffer graphics, render to each, and then XOR them together. This won't work in the emulator but something like this would be really fast:
2: There is some overdraw which is why you get the areas of black (where the same pixel has been drawn twice) but this is because the font is intentionally designed to take up very little space in memory. 3: I don't know what's happening there. What web browser are you using? I just tried
Posted at 2021-10-19 by ff2005 Thanks :D
Posted at 2021-10-19 by @gfwilliams
Should work, but maybe check the debug console to see if there are errors. Also just try clicking the button again just in case? If it's working you should see a preview of the font Posted at 2021-10-19 by @allObjects
I like that... that was the thought of how to update watch face in Bangle 1 with high frequency of events / the desire of (a) smooth sweeping hand (s). The issue is that keeping an. image in memory (buffer) all the time is a lot of memory. With a smart arrangement - diving the image up into quadrants (plus a few pixels for overlap) can cut the amount of working memory down to about a quarter (1/4, 25%). Posted at 2021-10-19 by @gfwilliams Actually one other (much better!) method that didn't occur to me until just now is to do two steps, and to use the transparency option when rendering to allow you to render the outside and then the inside of the circle:
There'd still be a moderate amount of flicker in the circle on Bangle.js 1, but I doubt it'd be too much of an issue Posted at 2021-10-19 by ff2005 Something in Brave is not working with the font converter (left: Chrome, right: Brave). Attachments: Posted at 2021-10-19 by @gfwilliams Interesting - thanks! Maybe as a privacy thing, Brave disables read-back from the Canvas element? Posted at 2021-10-19 by ff2005 Update on the watch faces. Thanks for the help. Attachments: Posted at 2021-10-19 by @gfwilliams Looks great!
Posted at 2021-10-19 by ff2005 I haven't explored what is the issue. Posted at 2021-10-20 by @gfwilliams Wow, very strange. I guess you'd have to dig into the code, but the Posted at 2023-01-19 by dapgo
Why? is it related to BJS1 lower specs? Attachments: Posted at 2023-01-20 by @gfwilliams In Bangle.js 2 we have a buffer for all the screen's data in the CPU's memory (in fact we have to because the minimum we can send to the Bangle 2 display is one entire line). It's easy to read from that. On Bangle.js 1 we write straight to the display (with no buffer because we don't have enough RAM to store 240x240x16 bits), and as far as I'm aware there is no way to read back because it's set up as an 8 bit parallel device and the 'read/write' pin is permanently wired to 'write'. I'd love to be proved wrong though, and maybe someone might be able to find a way of reading (but I doubt it). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-10-19 by ff2005
Hello
I have 3 small issues:
(see attached image)
There is something with the Vector font. I think the glyphs are not converted to path. :(
When trying the font converter I have allot of fonts with height = 1 (maybe I'm doing something wrong). Ex:
(see attached image)
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions