Following advice from https://stackoverflow.com/questions/36651509/psychopy-textstim-memory-leak-issue I’ve attempted to replace one of my TextStim stimuli with a TextBox (http://www.psychopy.org/api/visual/textbox.html)
I’ve replaced:
text_2 = visual.TextStim(win=win, name='text_2', text= 'c = 1\ndb = 2\nd = 3\neb = 4\ne = 5\nf = 6\ngb = 7\ng = 8\nab = 9 \na = 0 \nbb = t\nb = y' , font='Arial', pos=(0, 0), height=0.1, wrapWidth=None, ori=0, color='white', colorSpace='rgb', opacity=1, depth=-2.0);
with:
text_2 = visual.TextBox(window=win, text = "c = 1\ndb = 2\nd = 3\neb = 4\ne = 5\nf = 6\ngb = 7\ng = 8\nab = 9 \na = 0 \nbb = t\nb = y", font_size = 18, font_color = [-1,-1,1], color_space = 'rgb', size = (1.8,.1), pos = (0.0,0.0), units = 'norm')
and I’ve received the following error message:
FreeType import Failed: dlsym(RTLD_DEFAULT, FT_Library_SetLcdFilterWeights): symbol not found
Traceback (most recent call last):
File "/Users/sam/Downloads/AP_experiment_1/AP_exp_1_debugging.py", line 87, in <module>
text_2 = visual.TextBox(window=win, text = "c = 1\ndb = 2\nd = 3\neb = 4\ne = 5\nf = 6\ngb = 7\ng = 8\nab = 9 \na = 0 \nbb = t\nb = y", font_size = 18, font_color = [-1,-1,1], color_space = 'rgb', size = (1.8,.1), pos = (0.0,0.0), units = 'norm')
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/contrib/lazy_import.py", line 119, in __call__
obj = object.__getattribute__(self, '_resolve')()
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/contrib/lazy_import.py", line 88, in _resolve
obj = factory(self, scope, name)
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/contrib/lazy_import.py", line 203, in _import
module = __import__(module_python_path, scope, scope, [member], level=0)
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/__init__.py", line 59, in <module>
fm = getFontManager()
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/__init__.py", line 56, in getFontManager
_system_font_manager = FontManager(mono_only)
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/fontmanager.py", line 77, in __init__
self.updateFontInfo(monospace_only)
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/fontmanager.py", line 244, in updateFontInfo
self.addFontFiles(fonts_found, monospace_only)
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/fontmanager.py", line 151, in addFontFiles
face = Face(fp)
NameError: global name 'Face' is not defined
Any idea what I’ve done wrong/how to fix it? I basically want the TextBox to look exactly the same as the TextStim that I originally used - I’m just seeing if it sorts out a memory leak issue that I have.