Change of text alignment during recent updates?

0 votes
asked Mar 23, 2017 by anonymous

Could it be that somewhen during the last one or two updates something has happened to the text alignment of components (at least that’s where I noticed this)? The component title used to be centered which was true even for multi-line text. Now the text lines are rendered left-aligned. I liked it better before. Is there a way to get the old behaviour if not by default then by actively setting some option?

PNG of this code: ["component title\n more component info"]<<myStereotype>> now looks like:

------------------------------
|       <<myStereotype>>     |
| component title            |
| more component info        |
------------------------------

but it used to look like:

------------------------------
|       <<myStereotype>>     |
|       component title      |
|     more component info    |
------------------------------

 

However this only seems to happen, when the title exceeds some length. Weird.

 

 

1 Answer

0 votes
answered Mar 26, 2017 by plantuml (140,090 points)

You're right, the alignment is now left by default.

If you want to change this, you can download last beta
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0

And use:

@startuml
skinparam defaultTextAlignment center
[component title\n more component info] <<myStereotype>>
@enduml

Does it sound good to you ?

commented Mar 26, 2017 by anonymous
Perfect! Many thanks!
commented Dec 13, 2017 by Andreas Kågedal
The "default" in the parameter name `defaultTextAlignment` implies that it is possible to change the text alignment for specific texts (hopefully, in a specific note box for instance). Otherwise, the parameter would be called `textAlignment`.  Is this true? and if so, how is it done?
...