>>> from PIL.ImageFont import truetype
>>> import os.path
>>> fname = 'C:\\temp\\Шрифты\\font.ttf'
>>> os.path.exists(fname)
True
>>> truetype(fname)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\jenyay\.virtualenvs\outwiker-lFR0QK22\lib\site-packages\PIL\ImageFont.py", line 261, in truetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\jenyay\.virtualenvs\outwiker-lFR0QK22\lib\site-packages\PIL\ImageFont.py", line 144, in __init__
self.font = core.getfont(font, size, index, encoding, layout_engine=layout_engine)
OSError: cannot open resource
What did you do?
If
fnamecontains only Latin characters, then everything works.What versions of Pillow and Python are you using?
Pillow 5.0.1
Windows 7, Windows 10.
In Linux is OK.