You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ability to pass Pycairo objects to mapnik is excellent (allows for drawing multiple times to canvas). But difficulty of installation of pycairo and the extra complexity of passing pycairo objects to mapnik rendering and creating cairo contexts/surfaces, highlight the need to be able to write to cairo formats without pycairo using an API as simple as the current method of writing to AGG-based formats.
The attached patch makes it possible to write to cairo formats with only cairo/cairomm installed and using the python api like:
{{{
mapnik.render(map,'output.pdf') # extension will be used to select cairo renderer
or
mapnik.render(map,'output.png','ARGB32') # keyword will be used to select cairo renderer's PNG output (which can be non-Antialiased)
}}}
The text was updated successfully, but these errors were encountered:
[springmeyer] patch attached attempts to abstract the rendering to cairo file formats, and exposes the rendering to Cairo image formats (PNG) in non-antialiased mode.
This needs review and more thought:
How should rendering threads be handled in render_to_file when cairo is used?
Should this be further abstracted to avoid doing if type == "pdf" in the python bindings...
Should cairo formats be exposed in 'save_to_string' methods?
Should the Image object be extended to support/abstract cairo methods?
The ability to pass Pycairo objects to mapnik is excellent (allows for drawing multiple times to canvas). But difficulty of installation of pycairo and the extra complexity of passing pycairo objects to mapnik rendering and creating cairo contexts/surfaces, highlight the need to be able to write to cairo formats without pycairo using an API as simple as the current method of writing to AGG-based formats.
The attached patch makes it possible to write to cairo formats with only cairo/cairomm installed and using the python api like:
{{{
mapnik.render(map,'output.pdf') # extension will be used to select cairo renderer
or
mapnik.render(map,'output.png','ARGB32') # keyword will be used to select cairo renderer's PNG output (which can be non-Antialiased)
}}}
The text was updated successfully, but these errors were encountered: