TypeError:TypeError: decoding Unicode is not supported

Hi Daniel,

This works - thanks!! The only (and hopefully the last) problem though is that it still doesn’t work with my final set of stimuli :frowning:

Some words in my experiments are written in so-called FalseFonts, which I created using Monotype Type Drawing Office program. This program allows to create a font and then import it into Windows or Mac. So, I basically changed a bit my initial stimulus lists, because some words in .xlsx are written in this False font, but the PsychoPy doesn’t work anymore and gives the following error (see below). I’ve made also changes in the Builder, so font is not constant but a variable ($font, set at every repeat) and defined it (Arial, or FakeFont) in the corresponding .xlsx stimulus files.

You might think this is because PsychoPy doesn’t recognise this font, however when I tried to change a font in a code (simply replace Arial with FakeFont) it worked! All words were presented as fake words, but it seems I can’t put a font as a variable so that some other words are still presented in “normal” font.
Do I need to modify Monkey Patch function so that it has an attribute of “font” too? Any thoughts will be appreciated!

Alena

File “C:\Users\NCIL User\Desktop\alena exp\from mac\Kid_LDT_ERP_V3_final_version.py”, line 435, in
win.flip()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\window.py”, line 568, in flip
thisStim.draw()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\text.py”, line 722, in draw
self.setText()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\visual\text.py”, line 285, in setText
setAttribute(self, ‘text’, text, log)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\tools\attributetools.py”, line 137, in setAttribute
setattr(self, attrib, value)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\tools\attributetools.py”, line 30, in set
value=value)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.84.2-py2.7.egg\psychopy\tools\attributetools.py”, line 151, in logAttrib
value = getattr(obj, attrib)
AttributeError: ‘TextStim’ object has no attribute ‘my_text_function’

Well that error seems to be separate from any issues with the font, so first things first. My guess is adding this additional line will fix that:

visual.text.TextStim.my_text_function = my_text_function

This works - thank you very much, Daniel!

Still I have no idea how these are two separate issues from the font, because the font is presented correctly now too!

Well sorted @daniel.riggs1, thanks for digging us out of the hole I dug!

1 Like

You didn’t dig a hole at all! Turns out it was something I’d been meaning to figure out for a long time, so thanks for that!