plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.66k stars 878 forks source link

(timing diagram) message labels ignore default style #1746

Open chrisaga opened 2 weeks ago

chrisaga commented 2 weeks ago

Describe the bug Message labels have their own font name, style and size. They don't follow defaultFontName, defaultFontColor nor defaultFontSize. The only styling they accept is inheritance of message arrow's color.

To Reproduce Steps to reproduce the behavior:

  1. Copy one of the classic timing diagram examples with message arrows and render it
  2. See that the message label's font is different from other fonts
  3. Try to change default font style such as:
    skinparam defaultFontName "Serif"
    skinparam defaultFontSize 18
    skinparam defaultFontColor Blue
  4. Some text rendering change in the diagram but message labels don't

Expected behavior Message labels follow default styling.

Conclusion This should be a first step toward targeted styling of message labels which was what I was trying to achieve. I realize that would be a feature request. IMHO not following default style is a bug. Feel free to qualify this as a feature request too if I am wrong.

The-Lum commented 2 weeks ago

Hi @chrisaga, and all,

Here is a corresponding example:

From:

@startuml

robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU

@0
WU is Idle
WB is Idle
DNS is Idle

@+100
WU -> WB : URL
WU is Waiting
WB is Processing

@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL

@+100
DNS is Processing

@+300
DNS is Idle

@WU
@200 <-> @+150 : {150 ms}
@enduml

To:

@startuml

skinparam defaultFontName "SansSerif"
skinparam defaultFontSize 10
skinparam defaultFontColor green

robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU

@0
WU is Idle
WB is Idle
DNS is Idle

@+100
WU -> WB : URL
WU is Waiting
WB is Processing

@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL

@+100
DNS is Processing

@+300
DNS is Idle

@WU
@200 <-> @+150 : {150 ms}
@enduml

Regards, Th.

The-Lum commented 2 weeks ago

Hi @chrisaga, and all,

Thanks for the report,

Yes, it is a bug, because arrow's label seems to take the color from arrow LineColor and not from arrow FontColor...

Here is an example:

@startuml

<style>
arrow {
    FontName SansSerif
    FontSize 11
    FontColor green
    LineColor red
}
</style>

robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU

@0
WU is Idle
WB is Idle
DNS is Idle

@+100
WU -> WB : URL
WU is Waiting
WB is Processing

@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL

@+100
DNS is Processing

@+300
DNS is Idle

@WU
@200 <-> @+150 : {150 ms}
@enduml

Regards, Th.