I am currently working on a super short program which just takes a one word string input (in Thai) and then pass on the python program which has been written. I have a problem with dealing with Thai text. everything from inputing it to displaying it. Anyone has an idea if processing supports Thai or not or anything I can do.
Ps. I have tried enabling complext text input in the program but it does not seem to work for Thai
I think things should work if you do some small things: indicate strings are Unicode if you use Thai text in the code, string literals, like hello_text = u"āļŠāļ§āļąāļŠāļāļĩ" (note the u before the "). Because this is Jython/Python 2âĶ Otherwise you could use, first thing in your sketch:
from __future__ import unicode_literals
Get Processing to select an appropriate font for drawing, maybe like this:
If you use multiple tabs, beware the other .py files need to start with this âmagicâ comment: # -*- coding: utf-8 -*-
What other inputs do you need? Keyboard or reading text files?
Keyboard input in Processing is one key at a timeâĶ if Thai script needs key combinations to interact, Iâm not sure it would be able to capture those interactions, maybe a dialog window to get the whole word could help?
def input(question='', suggestion=''): # Processing Python mode does not have the built-in input()!!!
from javax.swing import JOptionPane
return JOptionPane.showInputDialog(None, question, suggestion)