Is is possible to configure the text font in the "then" branch?

0 votes
asked Jul 22, 2021 in Question / help by SuperSaiyanGod (340 points)

For example, we have the following uml:

if(some conditionthen (yes)

    :;

endif

Is it possible to configure the font of "yes"? And the position of it (for me, it is too close to the condition)? 

1 Answer

0 votes
answered Jul 22, 2021 by The-Lu (64,760 points)

Hello S.,

You can use creole for that with <font> and '\n':

@startuml
if(some condition) then (yes)
    :;
endif
if(some condition) then (\n<font:monospaced>yes</font>\n\n)
    :;
endif
if(some condition) then (\n<font:serif>yes</font>\n\n)
    :;
endif
@enduml

If that can help,
Regards,
Th.

commented Jul 23, 2021 by SuperSaiyanGod (340 points)
Thanks a lot! But it seems that it's not possible to configure the fontsize here, right?
commented Jul 23, 2021 by SuperSaiyanGod (340 points)
And is it possible to configure the style of these connectors in advance, just like the diamonds?
commented Jul 23, 2021 by SuperSaiyanGod (340 points)
I also found something peculiar here: the "no" displayed on the right branch is jammed together, while the "yes" on the left branch displays quite well.

The following gives an example:

if(Something?) then (yes)

    :Do the first thing;

    :Do the second thing;

else (no)

    :Do the third thing;

endif

I'm currently using the "Plantuml" plugin in VS Code and this phenomenon appears in the preview.

And strangely, if I export the diagram as a .svg file, it looks a lot better.
commented Jul 23, 2021 by The-Lu (64,760 points)

Hello S.,

You can manage size by creole <size:nn>:

if(some condition) then (\n<size:30><font:serif>yes</font>\n\n)
    :;
endif

And for style, use the arrow style, as:

<style>
activityDiagram {
  arrow {
    FontColor blue
    FontName arial
    FontSize 25
  }
}
</style>

We observe the expected result:

Then for the issue on VSCode, I can not reproduce....

If that can help,
Regards,
Th.

commented Jul 23, 2021 by SuperSaiyanGod (340 points)
Thanks a lot again!

I never imaged it's the arrow style, haha~

For the VS Code issue, maybe it is because my system language is Chinese? I'm not sure....
...