How to avoid for overlay of underlined {static} method/variable and underscore (_) for class diagram

0 votes
asked Apr 27, 2019 in Question / help by senooken (120 points)
static method or variable is underlined in class diagram.
If method or variable have undersocre (_), underscore and underline is overlay (ex. following example).

@startuml
class Class {
  {static} int under_score

}
@enduml

Do you know how to avoid this overlay?

I could not find parameter for skinparam (https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html or http://plantuml.com/skinparam).

2 Answers

+2 votes
answered May 21, 2021 by MarkWeyland (460 points)
selected May 23, 2021 by senooken
 
Best answer
The only work around I found was try out different fonts like this:

@startuml
listfonts <u>hello_world</u>
@enduml

And then choose the one that doesn't have this problem with

skinparam defaultFontName Noto Mono

for example.

Ideally, text rendering would be improved though.
commented May 23, 2021 by senooken (120 points)
Thanks for replying old question!  I think this is the best answer.

But PlantUML is sometimes poor. So I stopped to use PlantUML. I use Modelio.
0 votes
answered May 21, 2021 by Martin (8,360 points)
edited May 21, 2021 by Martin

I like the font answer above. 

But here's two alternative workarounds:

Make the underscore bold:

Make the underline lighter:

...