You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that when accessing chars like text[9], the emoji is returned in two parts (positions 9 & 10). A workaround is to do:
var chars = Array.from(text);
Then chars[9] will return "😄".
Applying this change to term.js:print() and canvas.js:drawText() seems to be enough to make the above program run correctly. The program listing still has problems though, because of the hid.js:render function.
The text was updated successfully, but these errors were encountered:
Today I learned about the Array.from function for Unicode conversion! Thanks for letting me know about this bug, though. I do think that emoji would be a welcome addition to atto! I'll look into this and let you know when it's all fixed.
All issues with rendering emoji should be solved now! Hopefully this will be a great addition for younger users of atto who want to add emojis to their programs. I remember users of educational programming languages such as Hopscotch heavily relying on emoji to convey pictorial meaning, so there's no doubt that emojis will be used a lot in atto!
Atto has problems with some Unicode characters (like emoji).
Example program:
test.atto.txt
The problem is that when accessing chars like
text[9]
, the emoji is returned in two parts (positions 9 & 10). A workaround is to do:var chars = Array.from(text);
Then
chars[9]
will return "😄".Applying this change to
term.js:print()
andcanvas.js:drawText()
seems to be enough to make the above program run correctly. The program listing still has problems though, because of thehid.js:render
function.The text was updated successfully, but these errors were encountered: