Closed glepore70 closed 9 years ago
You're right, I never used it on anything besides windows so I never added the folder lookups for other systems. Updated the code now with what I understand to be the default font folders for linux and mac. Just redownload the latest code from github and let me know if it still does not work or if the folders are wrong.
That got me past the initial error, now I'm running into an error where aggdraw is looking in the wrong location for fonts. It seems the fix is to re-install aggdraw with a custom FREETYPE font location defined, but I don't really want to do that. Thanks anyway.
rendering blockgroups 0%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100% ||||||||||||||||||||||||||||||||||||||||||||||||| task completed in 0.082135 seconds
Traceback (most recent call last):
File "test.py", line 2, in
Actually your new error is not related to the location of fonts at all, it just means that you cant draw text using the aggdraw renderer because you didnt install it with the freetype lib as you say. Instead just use a different renderer, so for instance:
geovis.SetRenderingOptions('PIL')
Or:
geovis.SetRenderingOptions('pycairo')
Getting a bit further, but no luck with either PIL or pycairo:
rendering blockgroups 0%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100% ||||||||||||||||||||||||||||||||||||||||||||||||| task completed in 0.34003 seconds
Traceback (most recent call last):
File "test.py", line 3, in
rendering blockgroups 0%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100% ||||||||||||||||||||||||||||||||||||||||||||||||| task completed in 0.358922 seconds
Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in *bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(_self.__args, _self.kwargs) File "/media/bigmedia/old/nara/shapefile/geovis/init**.py", line 1883, in ViewInTkinter resizedimg = self.renderer.img.resize((viewimgwidth,viewimgheight), PIL.Image.ANTIALIAS) AttributeError: 'cairo.ImageSurface' object has no attribute 'resize'
I'm getting the error below, any ideas? Look like the code doesn't support linux, since it only looks in Windows directories for fonts.
lepore@lepore-desktop:/media/bigmedia/old/nara/shapefile$ python test.py
rendering blockgroups 0%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100% ||||||||||||||||||||||||||||||||||||||||||||||||| task completed in 0.084586 seconds
Traceback (most recent call last): File "test.py", line 2, in
geovis.ViewShapefile("blockgroups.shp")
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 2593, in ViewShapefile
renderer.ViewShapefile(shapefilepath, customoptions)
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 1784, in ViewShapefile
self._RenderMapTitle(shapefilepath, customoptions)
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 1807, in _RenderMapTitle
self._RenderText(0.5, 0.05, customoptions["maptitle"], textoptions)
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 1809, in _RenderText
self.renderer.RenderText(relx, rely, text, textoptions)
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 956, in RenderText
self._BasicText(relx, rely, text, options)
File "/home/lepore/.local/lib/python2.7/site-packages/geovis/init.py", line 1065, in _BasicText
fontlocation = self.sysfontfolders[OSSYSTEM]+self.fontfilenames[options["textfont"]]
KeyError: 'linux'