You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Professor Corke, thank you for your precious work. when opening bdedit, I was encountering the following error (with the program crashing on startup):
Traceback (most recent call last):
File "/home/flavio/University/robotics/project/bdsim/bdsim/bdedit/interface_scene.py", line 143, in determineFont
self._system_font = ImageFont.truetype("arial.ttf", 14)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 996, in truetype
return freetype(font)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 993, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 248, in init
self.font = core.getfont(
OSError: cannot open resource
I don't know if this can be useful, but I (for now) fixed it by modifying this function :
def determineFont(self):
"""
This method sets the truetype font with which socket labels should be drawn.
Originally, this property was set within the sockets themselves, but when
they are constantly drawn/redrawn (i.e. when undo/redo is spammed) and as a
result, multiple attemps are made to access the truetype font, Windows issues
an OSError crashing the program... So since this font only needs to be defined
on startup, the font is accessed whenever the scene is created.
"""
try:
self._system_font = ImageFont.truetype("arial.ttf", 14)
except OSError:
self._system_font = ImageFont.load_default()
Thank you again
The text was updated successfully, but these errors were encountered:
Hi Professor Corke, thank you for your precious work. when opening bdedit, I was encountering the following error (with the program crashing on startup):
Traceback (most recent call last):
File "/home/flavio/University/robotics/project/bdsim/bdsim/bdedit/interface_scene.py", line 143, in determineFont
self._system_font = ImageFont.truetype("arial.ttf", 14)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 996, in truetype
return freetype(font)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 993, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/flavio/Programs/anaconda3/envs/robotics/lib/python3.10/site-packages/PIL/ImageFont.py", line 248, in init
self.font = core.getfont(
OSError: cannot open resource
I don't know if this can be useful, but I (for now) fixed it by modifying this function :
Thank you again
The text was updated successfully, but these errors were encountered: