New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note text has no text alignment skinparam & default alignment is not applied #134

Closed
jessetan opened this Issue Jul 3, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@jessetan

jessetan commented Jul 3, 2018

Skinparam for text alignment in notes

There is no skinparam that can be used to change the text alignment of a note (e.g. noteTextAlignment). Or maybe there is one, but it is not documented or has an unintuitive name.

Example

@startuml
skinparam noteTextAlignment center

Bob -> Alice : hello
note right
This is a note
can text be aligned or maybe centered?
endnote
@enduml

Default alignment does not always work

Additionally, the defaulttextalignment works for notes in activity diagrams, but not in sequence diagrams where note text is always left aligned

Example with text centered

@startuml
skinparam defaulttextalignment center

:Hello world;
:This is defined on
several lines;
note right
  This note is on several
  lines and can be aligned or centered
end note
@enduml

Example with text not centered

@startuml
@startuml
skinparam defaulttextalignment center

Bob -> Alice : hello
note right
This is a note
can text be aligned or maybe centered?
endnote
@enduml

@arnaudroques

This comment has been minimized.

Show comment
Hide comment
@arnaudroques

arnaudroques Jul 8, 2018

Contributor

Thanks for the feedback.
This is fixed in last beta http://beta.plantuml.net/plantuml.jar
We have also added a new "skinparam noteTextAlignment" parameter.
This has not been widely tested, so feedback welcome :-)

Contributor

arnaudroques commented Jul 8, 2018

Thanks for the feedback.
This is fixed in last beta http://beta.plantuml.net/plantuml.jar
We have also added a new "skinparam noteTextAlignment" parameter.
This has not been widely tested, so feedback welcome :-)

@jessetan

This comment has been minimized.

Show comment
Hide comment
@jessetan

jessetan Jul 9, 2018

That seems to work.
Is there a way to make the padding on the left side equal to the padding on the right? The right padding is larger so that the folded corner does not overlap the text, but it makes the text look not completely centered:
note padding

jessetan commented Jul 9, 2018

That seems to work.
Is there a way to make the padding on the left side equal to the padding on the right? The right padding is larger so that the folded corner does not overlap the text, but it makes the text look not completely centered:
note padding

@arnaudroques

This comment has been minimized.

Show comment
Hide comment
@arnaudroques

arnaudroques Jul 9, 2018

Contributor

Ok, we've build yet another beta. http://beta.plantuml.net/plantuml.jar
When center is used for note, the same padding is used on left and right so that text is actually centered.
Not widely tested... :-)

Contributor

arnaudroques commented Jul 9, 2018

Ok, we've build yet another beta. http://beta.plantuml.net/plantuml.jar
When center is used for note, the same padding is used on left and right so that text is actually centered.
Not widely tested... :-)

@jessetan

This comment has been minimized.

Show comment
Hide comment
@jessetan

jessetan commented Jul 10, 2018

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment