Giter Site home page Giter Site logo

pyagg's People

Contributors

karimbahgat avatar radarhere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyagg's Issues

Python 3 support

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.

pip install failed on linux(ubuntu and centos)

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.

Linux Support?

Would it be easy to add Linux support?

I'm using this library to test PyCRS.

canvas_test.py: TypeError

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.

Requires PIL/Pillow with FreeType enabled?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.