HTML-labels wrong centre alignment
dot - graphviz version 2.38.0 (20140413.2041)
For nodes that have HTML-labels where two rows have different font sizes, the center alignment is off.
Minimal example:
digraph {
node [shape=box];
foo[label=<Text text<br/><font point-size="10">longer text below longer text below longer text below</font>>]
}
Produced svg (dot g.txt -Tsvg -o g.svg)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="252pt" height="44pt"
viewBox="0.00 0.00 252.00 44.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 40)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-40 248,-40 248,4 -4,4"/>
<!-- foo -->
<g id="node1" class="node"><title>foo</title>
<polygon fill="none" stroke="black" points="244,-36 -1.42109e-14,-36 -1.42109e-14,-0 244,-0 244,-36"/>
<text text-anchor="start" x="96" y="-19.8" font-family="Times,serif" font-size="14.00">Text text</text>
<text text-anchor="start" x="8" y="-9" font-family="Times,serif" font-size="10.00">longer text below longer text below longer text below</text>
</g>
</g>
</svg>
The lower text is more to the left than center. Not sure why graphviz uses text-anchor="start" and then miscalculates the start position. Currently I'm fixing it by changing to text-anchor="middle" and replacing x with the polygon center coordinate.