How to send TextEdit object content into a context.

    Feb 06 2017 | 10:18 pm
    Hello. It seems like something that could be easily achieved. I would like to display the content of a TextEdit object into a context and have the exact same formatting has the text shown int the TexteEdit object window. Basically, I want to write text in a live situation.
    I was not able to achieve this with the since it does not take in consideration the line jump made by the ENTER key. Is there an object that could do the trick? Or does anyone has an idea of a method I could try? Thanks a lot for your help.

    • Feb 07 2017 | 4:53 pm
      if you want to simply read in and display a text file, then it is quite easy to do with jit.textfile. read it in and bang it out to
      if you want to display what you are typing live, then it's much more complicated. i've found the best way to do this is to use jit.str.fromsymbol to convert a line of text to a 1D matrix (the dim of the matrix equals the number of characters in the line of text) . you then copy this matrix into a 2D matrix (2nd dim represents the number of lines of text), using dstdimstart / dstdimend. this requires you to know the maximum line length and maximum number of lines you will by typing.
    • Feb 08 2017 | 12:07 am
      Your method (the second one) works perfectly for my purpose Rob! Again, thank you very much for your support. Cheers.