skinparam
命令来改变绘图的颜色和字体。
原文: You can change colors and font of the drawing using the skinparam
command.
示例:
skinparam backgroundColor transparent
You can use this command : * In the diagram definition, like any other commands, * In an included file, * In a configuration file, provided in the command line or the ANT task.
To avoid repetition, it is possible to nest definition. So the following definition :
skinparam xxxxParam1 value1
skinparam xxxxParam2 value2
skinparam xxxxParam3 value3
skinparam xxxxParam4 value4
严格等价于:
is strictly equivalent to:
skinparam xxxx {
Param1 value1
Param2 value2
Param3 value3
Param4 value4
}
skinparam monochrome true
命令。
You can force the use of a black&white output using skinparam monochrome true
command.
🎉 Copied!
|
![]() |
skinparam shadowing false
command.
🎉 Copied!
|
![]() |
skinparam monochrome reverse
命令,强制使用 黑和白 的输出,
在黑色背景的环境下,尤其适用。
You can force the use of a black&white output using skinparam monochrome reverse
command.
This can be useful for black background environment.
🎉 Copied!
|
![]() |
You can use either standard color name or RGB code.
🎉 Copied!
|
![]() |
transparent
只能用于图片背景
transparent
can only be used for background of the image.
xxxFontColor
, xxxFontSize
, xxxFontName
三个参数,
来修改绘图中的字体(颜色、大小、名称)。
You can change the font for the drawing using示例:xxxFontColor
,xxxFontSize
andxxxFontName
parameters.
skinparam classFontColor red
skinparam classFontSize 10
skinparam classFontName Aapex
也可以使用
skinparam defaultFontName
命令, 来修改默认的字体。
You can also change the default font for all fonts using skinparam defaultFontName
.
Example:
skinparam defaultFontName Aapex
请注意:字体名称高度依赖于操作系统,因此不要过度使用它, 当你考虑到可移植性时。
Helvetica
and Courier
应该是全平台可用。
Please note the fontname is highly system dependent, so do not over use it, if you look for portability.还有更多的参数可用,你可以通过下面的命令打印它们:Helvetica
andCourier
should be available on all system.
java -jar plantuml.jar -language
A lot of parameters are available. You can list them using the following command: java -jar plantuml.jar -language
left
, right
or center
, 可以设置文本对齐.
也可以 sequenceMessageAlign
指令 赋值为 direction
或 reverseDirection
以便让文本对齐与箭头方向一致。
Text alignment can be set up toleft
,right
orcenter
. You can also usedirection
orreverseDirection
values forsequenceMessageAlign
which align text depending on arrow direction.
Param name | Default value | Comment |
sequenceMessageAlign | left | 用于时序图中的 消息 (message) |
sequenceReferenceAlign | center |
在时序图中用于 ref over
|
🎉 Copied!
|
![]() |
🎉 Copied!
|
![]() |
🎉 Copied!
|
![]() |
🎉 Copied!
|
![]() |
🎉 Copied!
|
![]() |
🎉 Copied!
|
![]() |
本文档并不总能保持最新,你可以使用下面命令查看完成的参数列表
Since the documentation is not always up to date, you can have the complete list of parameters using this command:
java -jar plantuml.jar -language
或者可以使用命令,产生一幅有所有
skinparam
参数的图:
Or you can generate a "diagram" with a list of all the skinparam parameters using:结果如下:
That will give you the following result:
🎉 Copied!
|
![]() |
你也可以在 https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html 查看 ’‘skinparam’‘ 的参数. You can also view each skinparam parameters with its results displayed at the page [`All Skin Parameters`](https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html) of [`Ashley's PlantUML Doc`](https:plantuml-documentation.readthedocs.io/en/latest/index.html#): * [https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html](https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html).