fogleman / pg

Python OpenGL Graphics Framework

Home Page:http://pg.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

font example can't find font on Linux

stuaxo opened this issue · comments

If I rename the font to "arial.ttf" (which it is called on this system) I still get the error below, even though PIL.ImageFont can find the font.

Traceback (most recent call last):
  File "examples/font.py", line 13, in <module>
    pg.run(Window)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/pg-0.1-py2.7.egg/pg/core.py", line 822, in run
    window = cls(*args, **kwargs)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/pg-0.1-py2.7.egg/pg/core.py", line 613, in __init__
    self.call('setup')
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/pg-0.1-py2.7.egg/pg/core.py", line 707, in call
    if getattr(listener, name)(*args, **kwargs):
  File "examples/font.py", line 6, in setup
    self.font = pg.Font(self, 0, 'arial.ttf', 72)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/pg-0.1-py2.7.egg/pg/font.py", line 26, in __init__
    self.load(name, size)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/pg-0.1-py2.7.egg/pg/font.py", line 86, in load
    font = ImageFont.truetype(name, size)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 228, in truetype
    return FreeTypeFont(font, size, index, encoding)
  File "/mnt/data/home/stu/.virtualenvs/3d/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 131, in __init__
    self.font = core.getfont(font, size, index, encoding)
IOError: cannot open resource