Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.


HTML formatted text get cropped

0 votes

Hello everyone,

I'm creating an UML diagram, but as soon as I tried to add static methods/attributes I started having issues. I read that the only way to underline text (static methods/attributes must be underlined) is to use HTML markup, and so I did. But if the line is long, it crops the end of the line. If I remove the <html> placeholder all is fine (of course, except the fact that it is not underlined). Here an example:


The first line of the methods field is cropped, moreover the second line is not fully underlined

in Help by (220 points)

1 Answer

+1 vote
Java's text measurement for HTML sometimes has problems.

The simplest workaround is adding one or more &nbsp; entities at the end of long lines. The text will still be incorrectly cut off, but the cut off characters will be whitespace and thus the actual text will still be readable.
by [yWorks] (161k points)
Thanks, it works! Now the text isn't cut off, the only problem is that the last part of the second line is still not underlined, but it's a minor problem.
Do you have a link where I can read more about this issue? It's very weird!
No, unfortunately I do not have a link.

The last line not being underlined could be a closely related issue actually (i.e. incorrect vertical measurement of the text). Have you tried adding an additional line that consists of a single &nbsp; entity?
Thanks for the answer. Yes but unluckily it doesn't work with the underlined text. It's not a big issue tho. But can I ask you why don't you provide a more efficient way to format our text? I mean, in UML diagrams it is pretty common to have underlined text, and having to use html tags each time is a bit unconvenient (especially with this bug)
Legal Disclosure | Privacy Policy