How to make Class name bold in plant UML?

0 votes
asked Mar 19, 2022 in Question / help by Shadow43375 (140 points)

It is possible to style the class name in PlantUML to italic by making the class abstract. Is there a way to style the class name so that it is bold as in the example class below?

Bold class name

2 Answers

0 votes
answered Mar 20, 2022 by Martin (8,360 points)

You can use the creole markups, such as <B> for bold, in the class name; like so:

@startuml
class "<B>ClosedIssueState</B>" as ClosedIssueState #lightgreen {
getString : string
transitionNew() : void
transitionWork() : void
transitionConfirmed() : void
}

ClosedIssueState -> B
@enduml

+1 vote
answered Mar 20, 2022 by The-Lu (64,760 points)

Another solution...

If you does not use stereotype on class, with new style functionality is:

@startuml
hide stereotype
<style>
/' Bold Header '/
.bh {
  header {
    fontstyle bold
  }
}
</style>
class "ClosedIssueState" as ClosedIssueState <<bh>> #lightgreen  {
getString : string
transitionNew() : void
transitionWork() : void
transitionConfirmed() : void
}

ClosedIssueState -> B
@enduml

If that can help,
Regards.

commented May 11, 2023 by Eduard
edited May 11, 2023

Finally I got it! For me it works with style, for all classes in bold:    laugh

<style>
classDiagram {
  header {
    fontstyle bold
  }

}
</style>

...