Closed GoogleCodeExporter closed 9 years ago
I just converted one .dot generated by gprof2dot into svg, and opened with
firefox and the text looked fine.
Furthermore the generated .svg already has
font-size="10.00"
attributes all over the place.
Could it be that your firefox has some non-standard font settings? Or old
version of firefox/graphviz?
I'm using firefox version 24.5.0 and graphviz version 2.26.3.
Original comment by Jose.R.F...@gmail.com
on 28 May 2014 at 8:22
The verson I have is
$ dot -V
dot - Graphviz version 2.20.2 (Tue Mar 2 19:03:41 UTC 2010)
Each firefox version I've tested has had the same behaviour. I'm using firefox
29.0 currently.
`style="font-size: 10.00"` isn't actually a valid css rule (there's no units).
You'll notice the difference in this simple testcase in firefox (if you change
it to have units):
<!doctype html>
<html>
<body style="font-size: 10.00">
Hello world
</body>
</html>
Original comment by asott...@yelp.com
on 28 May 2014 at 8:32
Original comment by Jose.R.F...@gmail.com
on 13 Mar 2015 at 7:13
> `style="font-size: 10.00"` isn't actually a valid css rule (there's no units).
Instead of working around in gprof2dot, this should be fixed in graphviz. And
indeed there have been bugs reported:
http://www.graphviz.org/mantisbt/view.php?id=1702
http://www.graphviz.org/bugs/b1561.html
Unfortunately there has been no action.
And I'm afraid that working around in gprof2dot is not sustainable: it would
output for bakcends other than SVG.
Maybe posting a patch to graphviz developers might help making progress.
In the meanwhile my recommendation is either post-proccess the output with text
processing tool like `sed`, or use the graphviz PDF backend.
Original comment by Jose.R.F...@gmail.com
on 16 Mar 2015 at 12:14
This graphviz change should fix it:
{{{
diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c
index bb2ca7f..4d4818d 100644
--- a/plugin/core/gvrender_core_svg.c
+++ b/plugin/core/gvrender_core_svg.c
@@ -440,7 +440,7 @@ static void svg_textspan(GVJ_t * job, pointf p, textspan_t
* span)
gvprintf(job, " baseline-shift=\"sub\"");
}
- gvprintf(job, " font-size=\"%.2f\"", span->font->size);
+ gvprintf(job, " font-size=\"%.2fpt\"", span->font->size);
switch (obj->pencolor.type) {
case COLOR_STRING:
if (strcasecmp(obj->pencolor.u.string, "black"))
}}}
But per
https://github.com/ellson/graphviz/blob/master/plugin/core/gvrender_core_svg.c#L
14 this might actually be a bug in firefox...
Original comment by Jose.R.F...@gmail.com
on 16 Mar 2015 at 1:24
Original issue reported on code.google.com by
asott...@yelp.com
on 16 Apr 2014 at 9:02