The width of the text labels is calculated multiplying the number of characters by the font size. This can be weak if the font size is not a monospaced one.
It may be more consistent to calculate the bounding box of the label. This may also be used for non-text labels.
If we follow this approach we would need to plot the labels before plotting the tree because the size of the tree depends on the size of the largest leaf label.
The width of the text labels is calculated multiplying the number of characters by the font size. This can be weak if the font size is not a monospaced one. It may be more consistent to calculate the bounding box of the label. This may also be used for non-text labels. If we follow this approach we would need to plot the labels before plotting the tree because the size of the tree depends on the size of the largest leaf label.