Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002586graphvizDotpublic2016-01-15 20:532016-02-09 14:22
Assigned To 
PlatformFreeBSDOSFreeBSDOS Version10.2
Summary0002586: Generated svg graph spans outside of the bounding box
DescriptionThis graph:

digraph graphname {
  "<TOP>" -> "R#1117/3-R#1118/2";

When rendered with this command:
$ dot -Tsvg -Efontsize=8 -Gsize=12,4\! -Gdpi=79 -Gbgcolor=transparent

Produces the svg file which spans outside its box. Ellipse is being clipped. This should never be the case because dot has the freedom to decide what geometry it generates.
TagsNo tags attached.
Attached Files? file icon ooo.svg (Attachment missing)
png file icon dot-clipping-problem.png (Attachment missing)

- Relationships

-  Notes
User avatar (0001009)
yurivict (reporter)
2016-01-15 20:55

Attached the output svg.
User avatar (0001010)
yurivict (reporter)
2016-01-15 20:56

I tried chrome, firefox, gimp. They all render the same way.
User avatar (0001011)
north (administrator)
2016-01-15 21:14

The difficulty is that plain SVG is in some sense underspecified (what exactly is font="Times,Serif"?) so there is some disparity between cairopango (or quartz) and whatever renderer is invoked by Firefox or Safari or Chrome. Not sure why, but you have proved that there is.

A solution is to use dot -Tsvg:cairo, which forces the glyphs to be written into the output so that graphviz and the renderer agree.

Is there a better way?

User avatar (0001012)
yurivict (reporter)
2016-01-15 21:28

Using -Tsvg:cairo causes texts to turn into their pixelated representations. I don't think this is right.

Wikipedia has tons of svg images without any visible problems with them. How are svg images generated by graphviz any different?
User avatar (0001030)
ellson (administrator)
2016-02-09 14:22

The problem is related to the use of "-Gdpi=79" and the svg:core renderer.

I guess its a bug, but why would a user do this?

At this point "dpi" should be used only to provide a scaling for imported bitmap images. Something else is clearly happening here.

The problem does not happen with -Tsvg:cairo

BTW -Tsvg:cairo does not use pixelated fonts. Rather is renders fonts to vector glyphs based on fonts available on the host running dot, instead of assuming the existance of that same font on the machine rendering the SVG.

- Issue History
Date Modified Username Field Change
2016-01-15 20:53 yurivict New Issue
2016-01-15 20:53 yurivict File Added: ooo.svg
2016-01-15 20:55 yurivict Note Added: 0001009
2016-01-15 20:55 yurivict File Added: dot-clipping-problem.png
2016-01-15 20:56 yurivict Note Added: 0001010
2016-01-15 21:14 north Note Added: 0001011
2016-01-15 21:28 yurivict Note Added: 0001012
2016-02-09 14:22 ellson Note Added: 0001030

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker