Cannot use monospace font in state name

0 votes
asked Sep 14, 2020 in Bug by anonymous


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

state """State Name""" as S1
[*] --> S1

Results in syntax error:

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

1 Answer

0 votes
answered Sep 14, 2020 by The-Lu (36,200 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:

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,

commented Sep 16, 2020 by anonymous

Works like charm.