Text scaling inside classes

0 votes
asked Jun 29, 2018 in Bug by agillesp (600 points)

I don't know whether this is a bug or just me abusing class diagrams.

The following snippet used to result in a class containing two columns that were vertically aligned:

@startuml
skinparam
ClassAttributeFontName "Courier New"
class
MyClass {
  VeryVeryLongNameIndeed 1
  Short                  2
}
@enduml

The result now is some strange horizontal scaling on the second line:

I am currently using version 1.2018.08, although several versions before this would also do the same thing.

Is this a bug?

1 Answer

0 votes
answered Jul 10, 2018 by plantuml (294,960 points)

Maybe you can use the following example:

@startuml
hide empty members
skinparam ClassAttributeFontName "Courier"
class MyClass {
  VeryVeryLongNameIndeed\t1
  Short\t\t\t2
}
@enduml

Is this what you are expecting ?

http://www.plantuml.com/plantuml/uml/7Sv12i8m48NX_PnYw0tq19M28AWRmLKtgNdOO2SfayaYY7UtAO-t-nP_dysf5Lbe3XuCMQsoG2Peflm9SNNgX8V5vNmoqp0Lmpb5kpi1TqCg6g0TlHhWMzqXVudv2QtjrnJV3L-Y1_ne1s9-p4bjt7Ua7_M8Valu0m00

commented Jul 11, 2018 by agillesp (600 points)
Thanks for your response.

It does help in a lot of cases, although changing from a TrueType font (Courier New) to a bitmap font (Courier) also works without using escaped tabs.

I notice that there is a similar issue with notes, except there the "\t" solution doesn't work as it just inserts the literal characters "\t" into the note.

I have a suspicion there is an underlying bug in there somewhere, but the behaviour is not easy to understand.
commented Jul 12, 2018 by agillesp (600 points)
It is possible this issue may be related to this one:

        http://forum.plantuml.net/7909/why-is-text-so-stretched

It seems to occur only with TrueType fonts on Windows.
...