migurski / Dymo

Map label placer with simulated annealing.
148 stars 17 forks source link

Problem using 'ms_unicode_arial' font #42

Open ARSimmons opened 9 years ago

ARSimmons commented 9 years ago

The font file I have 'arial-unicode-regular' (MS license - not free) is not read by dymo. Is true-type free fonts the only option for being legible to PIL?

Error:

Traceback (most recent call last):

File "dymo-label.py", line 242, in for place in options.load_inpust(input_files, geometry, options.name_field, options.placement_field): File "I:\TFS_1\Dymo-maser\Dymoinit.py", line 206, in load_places yield_places.Point(name, fontfile, fontsize, location, point, radius, prperties, **kwargs) ...

File "C:\Users\ASimmons.irtualenvs\dymo_label_libs\lib\site-packages\PIL\ImageFont.py", line 253, in truetype return FreeTypeFont(filename, size, index, encoding) File "C:\Users\ASimmons.irtualenvs\dymo_label_libs\lib\site-packages\PIL\ImageFont.py", line 137, in init self.font = core.getfont(font, size, index, encoding) IOError: cannot open resource

...

ARSimmons commented 9 years ago

UPDATE: I tried switching font files (using a free 'DejaVuSansCondensed') and the error persists. I am using Pillow (the a replacement for pil), could that be tied to this?

Use from PIL import Image instead of import Image. ? (I verified that: \PIL\ImageFont.py does have 'from PIL import image')...