Cannot use monospace font in state name

0 votes
asked Sep 14 in Bug by anonymous

Hi,

I want to format state name in state diagram to be monospace, but it conflicts with state diagram syntax.

@startuml
state """State Name""" as S1
[*] --> S1
@enduml

Results in syntax error:

http://www.plantuml.com/plantuml/png/SoWkIImgAStDuG8oIb8Lb9IKWi4ClyJSL2178R5O8TYGArehLa5Nrmx4T4ZDIm6g1m00

Is there any other way to do monospace in state name?

1 Answer

0 votes
answered Sep 14 by The-Lu (8,340 points)
 
Best answer

Hello A.,

You can use those workarounds:


1. Globally change the defaultFontName for all text

skinparam defaultFontName monospaced
state "State Name" as S1

 See also: https://plantuml.com/font


2. Locally change font for specific text

state "<font:courier>State Name with Text on courier font" as S1
state "State Name 2 with <font:monospaced>Text on monospaced font" as S2


[See on PlantUML server]


If that can help,
Regards,
Th.

commented Sep 16 by anonymous
Thanks!

Works like charm.
...