jit.gl.text - non-alphabet (Asian) characters from matrix char data?
This is a bit of a niche question, but does anybody happen to know what text encoding system jit.gl.text uses to read from matrices for numbers outside the ascii printable character range? Everything from 33 to 126 outputs the correct corresponding ascii character, but I can't find any information about the higher numbers. 229 outputs a Chinese character; 239 outputs a Korean character; neither outputs are particularly common characters - so far the output seems completely random. Just to check these weren't somehow unicode, I also sent in matrix information encoded in three layers, but found that only changing the first layer char input actually modified the output. I know jit.gl.text can display any character (including non-alphabet characters) directly from a text message object; however, I specifically in this case need it to read from a matrix.
Asian characters do also give, according to atoi, five-number unicode codes (for example, 日 outputs 26085). I tried changing the matrix data type but jit.gl.text only accepts char, so this five-number string can't be inputted anyways. I don't know of any standard which encodes Asian characters as char (literally impossible given the 1-byte limit), so I'm not sure what else can be done beyond the aforementioned (failed) strategy of sending multiple layers. A bit stuck on this one.
You get it right, jit.gl.text only accept char-type matrices, which are limited to the first 256 ASCII characters. Would be nice if jit.gl.matrix could accept matrices of type long for bigger character sets.
I believe it should be a reasonable feature request, so I encourage you to send it to C74.
You're not the first person complaining about that recently (although I cannot find the older post I think about), so I guess it can really keep users with non latin alphabet away from jit.gl.text, which is a bit sad IMO.
As far as I know, the only way to send characters above the 256 base set is using regular messages. If you could describe more precisely what you want to do, I could help in converting your desired output from a matrix to a regular message that can be interpreted by jit.gl.text with non-latin characters.
Thanks, I think I might indeed end up sending cycling a feature request; basically having the option to have jit.gl.text read long inputs would allow for virtually all characters. To be clear, for values over 126 the output isn't even related to ascii anymore, at least not according to any standards I'm aware of. Sending messages is unfortunately not quite going to cut it as I need both x and y values (a grid of text mapped using jit.charmap).
127-255 characters are some "special" ones and accentuated letters, as you can see here. It's one ASCII standard among others, but it definitely exists. Not all glyphs can be displayed in jit.gl.text though.
Turns out you can actually make multi-line text without matrices. It requires to convert the the text to ascii integers, insert a 10 where you want new lines, and convert back to a symbol. Here I used "new_line" as a placeholder for each new line.
[textedit] can also do the trick. All depends where you get your text from and what manipulation you do with it.
If you get your text in the matrix form because you perform some matrix manipulation on it, there's a way to convert your matrix into a message while preserving new lines!
I know close to nothing in asian glyphs, so sorry in advance for what I wrote.
Thanks for this, very helpful - will play around and see if I can get this working with jit.charmap + matrix line breaks.