Skip to content

Unwanted space around html font tags with svg output

Steps to reproduce

Any html label with font color specification. For example:

digraph {
   main [
       label=<<font color='red'>main</font>( _1: <font color='darkgreen'>impl Fn()</font>, _2: <font color='darkgreen'>usize</font> )>
   ]
}

Expected output

This is what you get with

dot -Tpng my_file.dot
dot -Txlib my_file.dot

image

Actual behaviour

This is what you get with

dot -Tsvg my_file.dot

image

The difference is subtile, but there are extra spaces between main and the opening parenthesis, as well as between Fn() and the comma, and between usize and the closing parenthesis.

OS Version

Archlinux, up-to-date

Graphviz Version

$ dot -V
dot - graphviz version 2.44.1

Additional info

I discussed it on the forum and the bug was reproducible.

Edited by Robin Moussu