• I just try to save a font on SD and read it back.
    First I created an array like
    font = new Uint8Array(2404); //found this here http://mbed.org/users/dreschpe/code/TFT_fonts/file/76774250fcec/Arial12x12.h
    Next assigned Fontdata to this font.
    BTW, also tried to write this font as a variable and ran into out of memory.
    Saved this to SD by

    1. fs.writefile("font12.txt",font);
    2. fs.writefile("font12.json",JSON.stringify(font));
      I can read this by:
      t = fs.readFile(filename);
      But from this moment on I cannot create a new Uint8Array from the string.
      Tried this with both files.
    3. t = JSON.parse(fs.readFile(filename));
    4. t = fs.readFile(filename); f2 = eval(t);
    5. tried to create a new string to be prepared to eval
    6. tried to split the string
    7. and a lot of other combinations
      I ran into different problems like
    8. nothing happened
    9. out of memory
    10. total crash, where I had to reset
      What I would like to do is:
      Read the file, store it to flash and use it from there.

    Any idea how to do better ?

About

Avatar for JumJum @JumJum started