svg exports of diagrams with maxMessageSize/wrapWidth have spacing issues

0 votes
asked Apr 20 in Bug by kirchsth (6,660 points)
edited Apr 20 by kirchsth

this issue is related to a C4-stdlib discussion that the spacing is not correct in svg exports.

If I export e.g. following simple sample with skinparam maxMessageSize then all words are separated in the svg export. And if the sample is without then all words a written in one line and the rendering is much cleaner.

@startuml
skinparam arrow {
    FontSize 8
}
skinparam maxMessageSize 250

a -> a : **Perform the usual session auth**

@enduml


I overlaid the 2 exports it in following svg that you can see/compare the differences:


(if you open the image in a new tab and then see the source you will see the code of the generated svg)

The same problem can be reproduced with skinparam wrapWidth 300 too.

@startuml
skinparam arrow {
    FontSize 8
}
skinparam wrapWidth 300
skinparam maxMessageSize 150

rectangle "Perform the usual session auth" as a

a -> a : **Perform the usual session auth**
@enduml


I think one of following solutions could work
a) all words which fit in one line are combined 
b) "x" and "width" looks rounded for me in svg (and y has values like 57.7227) maybe x/width can be written with the same number of decimals 

Thank you and best regards
Helmut

commented Jun 28 by kirchsth (6,660 points)

If rendering hint would be used in PlantUML DriverTextG2d class, like

g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);

then it would creates a text like the line 3.

And the sequence diagram would look like

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...