如何在 Plant UML 中将类名设为粗体

发布于 2025-01-15 22:18:26 字数 208 浏览 3 评论 0原文

通过使类抽象,可以将 PlantUML 中的类名设置为斜体。有没有办法设置类名称的样式,使其像下面的示例类一样粗体

粗体类名

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

辞别 2025-01-22 22:18:26

您可以将类的名称放在“**和**”之间。

例子:

@startuml

class **House** {

}

@enduml

you can put the name of the class between "** and **".

Example:

@startuml

class **House** {

}

@enduml
故事↓在人 2025-01-22 22:18:26

现在有支持样式的工作(查看 PlantUML Q&A 论坛以获取更多信息)。

@startuml
<style>
classDiagram {
  class {
      ' attributes and methods
      FontColor blue
      BackgroundColor yellow
      ' class name
      header {
        FontSize 20
        FontColor violet
        FontStyle bold
      }
  }
}
</style>

hide circle

class User {
  name : String
  id : integer
  toString() : String
}

@enduml

<一href="http://www.plantuml.com/plantuml/uml/NKzHQYin3FoEJZ5_UU-hfPybbD2MNY3q0Dwrs3MLRP3bbZJitRlsfWGgC6X6ch7cMCofrIXqA7OMVg9HN2clmKtg8Yu4TA9tlxM7CzCmLEC2bpmYsvn zeHtmbfEzPCcAGIetvjcD7vFcclp6draaVxN9_kgTNEoRCplFYalhTyte5BuP3_STtum_GnOsmf_gWf O1GnRVD0krjz3XxfgDvk0POz1HcBQaU2_zI_Ghy8YJQKZJYeDVKKZ64-iABM-JV_zlImlHaPElKNu0" rel="nofollow noreferrer">在此处输入图像描述

There is work now to support styles (check the PlantUML Q&A forum for more info).

@startuml
<style>
classDiagram {
  class {
      ' attributes and methods
      FontColor blue
      BackgroundColor yellow
      ' class name
      header {
        FontSize 20
        FontColor violet
        FontStyle bold
      }
  }
}
</style>

hide circle

class User {
  name : String
  id : integer
  toString() : String
}

@enduml

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文