-
• #2
Yes, it is a bit confusing, but basically:
flash_length
is how much internal flash you haverequire("Flash").getFree()
is the memory in internal flash, not used by Storagerequire("Storage").getFree()
is the memory available in Storage, in Bangle.js this is external storage
Do I actually have 8 MByte available for access through the 'Storage' module ?
Yes.
What then is the length of 483328 for the 'Flash' module ?
That's internal flash that isn't used by code
All these questions because I need 'a lot' of space for storing a Far-East unicode font...
Eep. Obviously I don't know quite what you have planned, but the approach I'm taking with text messages on Bangle.js is to render them to a bitmap on a bigger computer, and send the bitmap over rather than just the text.
You can now add images in-line in text that you draw with drawstring (just add a 0 character then the raw image data in Espruino's image format) so it may be quite easy to implement.
The very newest firmware actually has two blocks of memory used for storage - internal and external - so it is possible to use that ~500k of internal flash as well.
However I feel like if the difference between 8MB and 8.5MB is a killer for you, it may be worth looking at different approaches.
-
• #3
you can now add images in-line in text
Could you do an example code snippet.
-
• #4
Like this:
var txt = "Hello \0" + atob("HBKBAD///8H///iP//8cf//j4//8f5//j/x/8//j/H//H4//4PB//EYj/44HH/Hw+P4//8fH//44///xH///g////A==") + " World"; g.clear(1).setFontAlign(0,0).setFont("6x8"); g.drawString(txt,88,88);
stringWidth/stringMetrics/wrapString will work even with the image inline too. Only gotcha is the line height is the height of the text, not that of the image (which is centered)
1 Attachment
Hi,
The Bangle.js 2 feature page notes :
I'm confused about Espruino's various getFree() outputs :
'flash_length' would then be the size of the internal flash ?
And then there is :
After reading
I thought the 'Flash' and 'Storage' modules accessed the same Flash memory, with a separate API (roughly page vs file). But how then is the getFree() output to be interpreted ? Do I actually have 8 MByte available for access through the 'Storage' module ?
What then is the length of 483328 for the 'Flash' module ?
(I have about 60 kByte of code and files on the Bangle.js 2 for the moment, so I don't think it has anything to do with the Flash not being consecutive anymore.)
(All these questions because I need 'a lot' of space for storing a Far-East unicode font...)