Is there a way to add a background to edge labels? I tried fillcolor but it only colors the arrow, and the edge labels kept having a transparent background.
I tried signing up to GitLab but it seems it doesn’t support my region anymore[1]. It said will redirect me to JiHu but the landing page is 404. What the heck
Sorry about the problem. This has been discussed and explained enough times already. The issue is, “Graphviz generates host-dependent SVG.” It can manifest itself in various ways, e.g. “text label is clipped” “text label overflows into another object” “text label background is incorrect” but they are all the same thing.
Ways we may approach this:
Don’t change anything, just continue to explain/ignore.
Deprecate/remove the native SVG driver in favor of cairopango, which does its own font embedding to avoid this issue.
Program a font embedding feature like that of the cairopango driver into the native SVG driver, unfortunately giving up some of its simplicity and “efficiency.”
Figure out and program a way to display a warning when host-dependent SVG is moved to an incompatible host. Not sure this can be done without Javascript or other executable semantics that may be incompatible with the way the native SVG output is probably being used, so this may not even do any good.
If there’s an issue to be filed, I can happily do this. But I don’t think it would gain us much as you presumably could not get notifications about updates to it there. You’ve got the attention of the main Graphviz developers on the forum here already.
You’re assuming hsambirchaaaaaaaaa generated the graph on one machine and is viewing it on another? I guess that could be the cause, but I don’t see anything in their previous replies that suggests they’re doing this.
You’re right, I have no basis to say the SVG was generated on one machine and viewed in another.
It’s better to say, “Graphviz generates host / renderer dependent SVG.” For example on a given machine, Graphviz might use system fonts while other programs (like Chrome, Microsoft Office, Inkscape, and Adobe Illustrator) might each have their own additional fonts.
I feel indifferent about it… Since it’s an instance of a known bug pattern, just let me know when it’s going to be fixed so that I can verify. Or ask me here for further information.
Sorry, I meant to amended my previous comment about this. Not “host-dependent”, but “renderer-dependent” SVG, where “renderer” includes the internal renderer in graphviz that is executed to get text label sizes.
I don’t see any good solution to this with our native SVG generator.
We believe this problem exists, no need to spend effort on reproducing it in new ways.
As far as I can tell, there is no way to fix this hole without buying into a lot of complexity that defeats the point of having the native SVG generator. (The complexity would be either coming up with a full font embedding scheme like cairopango has, but why even bother, that already exists? Or assume that the SVG can contain, er, Javascript, that can have functions to get the sizes of things at runtime. Again this seems to defeat the concept of having a “simple,” parsable XML format for graphics. Would require some major hackery in the SVG driver, too.
Because -Tsvg:cairo exists, there’s an available work-around. Does the -Tsvg:cairo option do what you need?
So my previous claim is wrong, it doesn’t ignore the fontname, but Cairo output is noticably uglier than non-Cairo. Cairo can technically work for me but I’ll still fall back to padding spaces at the end of the label without Cairo
Yes I can reproduce after fixing a font as shown in the non-Cairo generation here
Just speculating, but wonder if would help for the graphviz SVG generator to explicitly find and emit (rebind) font-family using the pango font description. It would need to happen around here in svg_textspan. Also I’m not sure about the case analysis that happens before this (PSFONTS, SVGFONTS, or NATIVEFONTS) and how that should affect the lookup. Something to think about, though.