How can I insert a single space character at the end of a Sequence diagram message (arrow) text?

0 votes
asked Mar 23 in Question / help by 1derer (140 points)

Hello all.

Since message text is specified without wrapping it in quotes like a regular string, I cannot control the format of the text beyond special escape directives such as "\n", "\t", "\l" and "\r".

Is there a way to an additional space to the text?

Take this as an example:

@startuml
a -> b : I need an additional space at the end
@enduml

That will render the text as "I need an additional space at the end" on top of the arrow, but I'd like it to render the equivalent of "I need an additional space at the end   " ( <- additional space character or invisible space after the last word) so the "end" word is not too close to the vertical line that originates in participant b to the right, as sometimes it gets to tight in there or it looks confusing while merged with the lifeline to the right of it.

The ideal way of doing this would be controlling the margins of the message text so enough space is kept to the right and left, but it would be nice anyway to be able to control the format of the text beyond the newline and alignment escape characters, and add spaces wherever you intend if needed.

Any other workaround to achieve what was described above is welcome too.

Thanks.

1 Answer

+1 vote
answered Mar 23 by Martin (3,880 points)
selected Mar 24 by 1derer
 
Best answer

The ascii code for a space is hex 20.  So you can use the unicode character syntax:

@startuml
a -> b : I need an additional space at the end<U+0020>
@enduml

...