I’m building a multilingual vocal Stroop experiment, in which the subject should name the ink color in a different language from the stimuli.
My text stimuli include Thai color words, e.g. ขาว แดง เขียว เหลือง ชมพู ม่วง เทา.
While running the experiment, the following errors were reported:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\text.py", line 373, in setText
setAttribute(self, 'text', text, log)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\tools\attributetools.py", line 141, in setAttribute
setattr(self, attrib, value)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\tools\attributetools.py", line 32, in __set__
newValue = self.func(obj, value)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\text.py", line 364, in text
self._setTextShaders(text)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\text.py", line 388, in _setTextShaders
multiline=True, width=self._wrapWidthPix) # width of the frame
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\__init__.py", line 453, in __init__
multiline, dpi, batch, group)
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\__init__.py", line 275, in __init__
dpi=dpi, batch=batch, group=group)
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 810, in __init__
self.document = document
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 919, in _set_document
self._init_document()
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 1020, in _init_document
self._update()
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 956, in _update
lines = self._get_lines()
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 932, in _get_lines
glyphs = self._get_glyphs()
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\text\layout.py", line 1059, in _get_glyphs
glyphs.extend(font.get_glyphs(text[start:end]))
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\font\base.py", line 385, in get_glyphs
self.glyphs[c] = glyph_renderer.render(c)
File "C:\Program Files\PsychoPy3\lib\site-packages\pyglet\font\win32.py", line 431, in render
ord(text), ord(text), byref(abc)):
TypeError: ord() expected a character, but string of length 2 found
I have tried to change many fonts but always encounter with these errors. Sometimes, the program also generates this error:
TypeError: 'NoneType' object is not subscriptable
Is there anyway to solve this problem? How should I proceed so that PsychoPy could recognize Thai unicodes and/or Thai fonts?
Or could you recommend any font which is compatible with Thai letters?
I have no experiences with programming or with Python. Thus, any help would be really appreciated!