Rendering PlantUML legends as SVG drops colors

0 votes
asked Jun 21 in Bug by Gerd Aschemann

With the following legend in PlantUML

legend right
|= |= Type |
|<back:red>    </back>| Abcdef |
|<back:blue>    </back>| Uvwxyz |
endlegend

I get a nice PNG but an SVG without colors (cf. attached test-results.zip - Github does not allow to upload SVGs directly).

Cf. https://github.com/asciidoctor/asciidoctor-diagram/issues/184

1 Answer

0 votes
answered Jun 21 by plantuml (184,600 points)

Well, the issue seems to be on the SVG implementation :-)

For text containing only spaces, even with some background color, SVG rendering do not display anything :-(

A possible workaround could be to use "IDEOGRAPHIC SPACE" (see http://jkorpela.fi/chars/spaces.html )

@startuml
Bob -> Alice : hello
legend right
|= |= Type |
|<back:red><color:red><U+3000></color></back> | Abcdef |
|<back:blue><color:blue><U+3000></color></back> | Uvwxyz |
endlegend
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vyf9JK_DIr4eoapFAE6giLK0ef3AWbI56guQcwJ4v6ohejGKEvla_9py8WWpLDlOmC30paOVB0QaGQhi56eK79EIKrBJ41gJSafJeJh1R3nQGylAAoghW5g1Je4uYCi1I00T3G00

Note that we *could* implement the workaround in PlantUML code (that is changing pure "space" text to "ideographic space" for SVG output), but that would be weird, so if possible, we'd like better that you use the workaround.

Any though ?

...