If this template helps then use it. If not then just delete and start from scratch.
OS: Windows 10
PsychoPy version : v2023.2.2
Standard Standalone? (y/n) If not then what?: yes
What are you trying to achieve?: I am trying to fit a letter and a number onto a screen with a background color of either blue or orange.
What did you try to make it work?: The program works, but sometimes I will get this runtime error and it will crash:
RuntimeError: Failed to fit char into font texture (b'Arial' at size 432.0px)
The letter number combinations are random, so I ordered to to go in order (A1, A2, A3 …, Z10) and whenever it got to X it crashed. Same thing if the number was first (1A, 2A, …, 10Z), it would get to 1X and crash
I have tried changing font sizes, making the font not bold, changing the layout size, height, changing border width, and changing formatting. I get the same error, sometimes with different pixel sizes (e.g. (b’Arial’ at size 368.0px))
Longer version of the error message:
File "C:\Users\jackpmanning\OneDrive - Texas A&M University\Documents\Projects\vssdt\PsychoPy\Gait\Number_Naming_Task_lastrun.py", line 990, in <module>
run(
File "C:\Users\jackpmanning\OneDrive - Texas A&M University\Documents\Projects\vssdt\PsychoPy\Gait\Number_Naming_Task_lastrun.py", line 702, in run
Number_naming_prompt.setText(Combined)
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 1518, in setText
setAttribute(self, 'text', text, log)
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py", line 134, in setAttribute
setattr(self, attrib, value)
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 783, in text
self._layout()
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\visual\textbox2\textbox2.py", line 875, in _layout
glyph = font[charcode]
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\visual\textbox2\fontmanager.py", line 389, in __getitem__
self.fetch('%c' % charcode)
File "C:\Users\jackpmanning\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\visual\textbox2\fontmanager.py", line 532, in fetch
raise RuntimeError(msg)
RuntimeError: Failed to fit char into font texture (b'Arial' at size 432.0px)```