Modify

Opened 8 years ago

Closed 5 years ago

#737 closed enhancement (wontfix)

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

Reported by: tizianomueller Owned by: pkropf
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 7 years ago by Blackhex

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 7 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 6 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 follow-up: Changed 6 years ago by cboos

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 5 years ago by cboos

  • Resolution set to wontfix
  • Status changed from new to closed

Replying to cboos:

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from pkropf. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.