karimbahgat / pyagg Goto Github PK
View Code? Open in Web Editor NEWConvenience wrapper around Aggdraw for easy lightweight drawing
License: MIT License
Convenience wrapper around Aggdraw for easy lightweight drawing
License: MIT License
Just found this project and it looks very promising.
I am using the aggdraw
module for one of my projects and I have fixed a couple bugs (path drawing) and added Python 3 support. You can find my version of aggdraw
here.
I tried running a couple of your tests using python 3, but it looks like the code is still python 2 only (old style print statements, etc.). You might consider upgrading the code to be python-2 or 3 compatible. I found the modernize
(aka python-modernize) package to be very useful for converting the files in my project, requiring only minimal fix ups afterwards. It uses the six
module to achieve compatibility.
I am trying to install on linux, but get an error:
Downloading PyAgg-0.1.zip (753kB)
100% |################################| 757kB 157kB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/PyAgg.egg-info
writing pip-egg-info/PyAgg.egg-info/PKG-INFO
writing top-level names to pip-egg-info/PyAgg.egg-info/top_level.txt
writing dependency_links to pip-egg-info/PyAgg.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/PyAgg.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
error: package directory 'pyagg\fontTools' does not exist
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4nQOTm/pyagg
It's not convenient for me to clone the repository and run setup.py, would be great if you can fix the pip problem, thanks in advance.
Would it be easy to add Linux support?
I'm using this library to test PyCRS.
micah@micah-VirtualBox:~/PyAgg-master$ python canvas_tester.py
Traceback (most recent call last):
File "canvas_tester.py", line 195, in <module>
test_text()
File "canvas_tester.py", line 36, in test_text
canvas.draw_axis("x", 0, 140, 0, 25, ticklabeloptions={"textsize":30, "rotate":40, "anchor":"sw","fillcolor":"white"})
File "/home/micah/PyAgg-master/pyagg/canvas.py", line 1178, in draw_axis
for x in xpos:
TypeError: 'int' object is not iterable
This happens on Linux and Windows using Python 2.7.
C:\Users\mcochran\Downloads\PyAgg-master>python legend_tester.py
None
None
[<pyagg.legend.Symbol instance at 0x029CE990>, <pyagg.legend.Symbol instance at
0x029CE2D8>]
[<pyagg.legend.Symbol instance at 0x02337E90>, <pyagg.legend.Symbol instance at
0x02337EB8>]
[<pyagg.legend.Symbol instance at 0x02337F30>, <pyagg.legend.Symbol instance at
0x02337F58>]
[<pyagg.legend.SymbolGroup instance at 0x02337E40>, <pyagg.legend.SymbolGroup in
stance at 0x02337EE0>, <pyagg.legend.SymbolGroup instance at 0x02337F80>]
Traceback (most recent call last):
File "legend_tester.py", line 70, in <module>
legend.render().save("testlegend.png")
File "C:\Users\mcochran\Downloads\PyAgg-master\pyagg\legend.py", line 97, in r
ender
rensymbols = [s.render() for s in self.items]
File "C:\Users\mcochran\Downloads\PyAgg-master\pyagg\legend.py", line 30, in r
ender
rendered = self.type(**self.kwargs)
File "legend_tester.py", line 42, in <lambda>
legend.add_item(Symbol(lambda: label("SymbolGroup 3")))
File "legend_tester.py", line 40, in label
c.draw_text(text,(0,0),anchor="nw", textsize="40%")
File "C:\Users\mcochran\Downloads\PyAgg-master\pyagg\canvas.py", line 1833, in
draw_text
font = PIL.ImageFont.truetype(fontlocation, size=options["textsize"]) #, opa
city=options["textopacity"])
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 218,
in truetype
return FreeTypeFont(filename, size, index, encoding)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 134,
in __init__
self.font = core.getfont(file, size, index, encoding)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 34, i
n __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed
C:\Users\mcochran\Downloads\PyAgg-master>python graph_tester.py
Traceback (most recent call last):
File "graph_tester.py", line 125, in <module>
test_smoothline().save("__private__/test_output/smoothline.png")
File "graph_tester.py", line 14, in test_smoothline
canvas.draw_text("Hello", (50,50), textfont="segoe print bold", textsize=55)
File "C:\Users\mcochran\Downloads\PyAgg-master\pyagg\canvas.py", line 1833, in
draw_text
font = PIL.ImageFont.truetype(fontlocation, size=options["textsize"]) #, opa
city=options["textopacity"])
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 218,
in truetype
return FreeTypeFont(filename, size, index, encoding)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 134,
in __init__
self.font = core.getfont(file, size, index, encoding)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\PIL\ImageFont.py", line 34, i
n __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed
Stack overflow told me that PIL/Pillow requires FreeType to be enabled. The way to resolve this would be adding that this is required to the documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.