Is there a supported way to specify fall back fonts?

0 votes
asked Nov 29, 2019 in Question / help by roxspring (260 points)

Specifying a specific font name for use in diagrams works great:

DefaultFontName "Proxima Nova Cn CF"

PNG images use the correct font if available, SVG images reference the correct font and render correctly where the client has the correct font available. But our preferred font isn't available everywhere and we'd like to make use of CSS font fallback. We tried the following:

DefaultFontName "Proxima Nova Cn CF", "DejaVu Sans", "SansSerif", sans-serif

This is great and means that SVGs fall back to some more commonly available fonts, but this breaks the PNG export because presumably the render is looking for a single font with that long compound name.

Is there a better way of achieving the result I'm after?

If not then could we have PNG renderer support a fallback list of fonts in DefaultFontName?



2 Answers

0 votes
answered Dec 1, 2019 by plantuml (226,400 points)

It's not possible yet...

However, this is a nice suggestion so with last beta , you can now have:

skinparam DefaultFontName Proxima Nova Cn CF, DejaVu Sans, SansSerif, sans-serif
Alice -> Bob : hello

In case you are interested, the patched code is here

0 votes
answered Dec 20, 2019 by plantuml (226,400 points)
This has been released in last version V1.2019.13