Sans serif font for Gantt diagram

+1 vote
asked Aug 18, 2020 in Wanted features by Emmanuel
Hello !

Would it be possible to change the currently used font for Gantt diagrams to a sans serif one, like Arial or DejaVu Sans? Since Gantt diagrams are mainly to be shown on screen, and since PlantUML images are low DPI, serif font as used now reduces readability.

Thanks !

Emmanuel
commented Aug 18, 2020 by albert (3,520 points)

With: java -Djava.awt.headless=true -jar plantuml.jar  -language

you get (o.a.) all recognized skin parameters, here you can search for all the FontNames that can be changed (I count 84 in PlantUML version 1.2020.16beta8), though it looks like there is not direct one general one for Gantt charts.

commented Aug 19, 2020 by Emmanuel
Thanks for your answer that pointed me to the skinparam directive.

But the Gantt diagram doesn't seem to allow skinparam. You can look at this http://www.plantuml.com/plantuml/umla/SoWkIImgIK_CAodXAixEp2j8B4hCLKX9JKiipIbnoyyhyKlCJLNmICqfIot9J4xaYWv9BCwELSX9B2ufLZ0oK4X9h2pcSaZDIm4R0G00 where I'm using the specific starting command.

Or this where I use the @startuml generic one: http://www.plantuml.com/plantuml/umla/SoWkIImgAStDuIhEpimhI2nAp5L8IKrBBCqfSSlFA_5Bp4rLy4ZDAKijoKnEv8eEIIpEZbN8IImkALOmCb18IQmivd98pKi16W00

In either case, there is a syntax error which disallows me to change any styling parameters. Perhaps am I doing wrong ?
commented Aug 19, 2020 by The-Lu (64,340 points)

1 Answer

0 votes
answered Aug 21, 2020 by plantuml (295,000 points)
 
Best answer

With last beta http://beta.plantuml.net/plantuml.jar, you can now have

@startuml
<style>
ganttDiagram {
    task {
        FontName Helvetica
        FontColor red
        FontSize 18
        FontStyle bold
        BackGroundColor blue
        LineColor yellow
    }
    milestone {
        FontColor blue
        FontSize 25
        FontStyle italic
        BackGroundColor yellow
        LineColor red
    }
}
</style>
[Task] lasts 20 days
[M1] happens on 5 days after [Task]'s end
@enduml

...