Modify

Opened 18 years ago

Closed 16 years ago

#737 closed enhancement (wontfix)

Use cairo instead of librsvg to render antialiased png's (from svg)

Reported by: Tiziano Müller Owned by: Peter Kropf
Priority: low Component: GraphvizPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description

At the moment librsvg is needed to render antialiased png. The problem is that the dependencies for this lib in fact require a complete X-Window environment.
With cairo and libsvg-cairo (and the python-bindings of course) it would be possible to render the svg's generated by the graphviz tools to png with very decent performance.

Example-Code:

import cairo, cairo.svg
svgctx = cairo.svg.Context()
svgctx.parse("test.svg")
width, height = svgctx.get_size()
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
svgctx.render(ctx)
surface.write_to_png("test.png")

I'll try to write a patch within the next week.

Attachments (0)

Change History (5)

comment:1 Changed 18 years ago by Radek Bartoň

Futhermore there is an unpleasant bug in dot's SVG export where long labels overlaps node, which makes this file type unusuable to draw UML class diagram charts.

comment:2 Changed 18 years ago by whiteblizzard

Workaround for this is to specify:

#!graphviz.dot/gif

as the header for your dot code. This way you loose the anti-aliasing, since it isn't implemented for gif files. Caveat: If you set a size parameter the fonts will look very ugly.

comment:3 Changed 17 years ago by anonymous

stair parts Frequent Buyer Discounts available to Builders & Contractors on stair parts and wrought iron balusters We Ship Fast - Call us for an estimated shipping time. iron railing and fences with decor design We offer both Amish Quality and Contractor Grade Stair Parts. step railing Our customers are loyal, find out why!

comment:4 Changed 16 years ago by Christian Boos

Suggesting a wontfix here, as graphviz itself can be built with cairo support, see http://www.graphviz.org/Download_source.php.

Looking at version 2.20.3 (current stable as of today), it's even the default:

  --with-pangocairo=yes   pangocairo library

Installing all the dependencies is of course a bit tedious if you have an old system, but probably no more work than getting the dependencies for the suggested pipeline (or the one suggested in #1610). Once you have it in place, it's certainly a more robust solution.

comment:5 in reply to:  4 Changed 16 years ago by Christian Boos

Resolution: wontfix
Status: newclosed

Replying to cboos:

Suggesting a wontfix here, as graphviz itself can be built with cairo support, see http://www.graphviz.org/Download_source.php.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Kropf.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.