The steps to add an icon library are:
INFO
fileGenerating.puml
files from a bunch of SVGs can be done using plantuml.jar -encodesprite
1
It is quite common for icon-sets to either exist out of SVGs or be generated from SVGs, so source SVGs are often already available.
Figuring out which settings to use with encodesprite
can take some trial-and-error.2
I remember looking into https://github.com/tupadr3/font-icon-generator but I can really remember how things work, so for now YMMV.
Once you have a bunch of generated .puml
files, it is a good idea to create a common/main file that includes all the sprites, to save users the hassle of having to load each sprite individually.3
Adding a README explaining things a bit is also a good move.
To add an icon library to this project (i.e.e the PlantUML stdLib), open a merge request with:4
INFO
fileINFO
fileThe INFO
file should contain the version (i.e. the git tag or github release) of the icon-set you are adding and the source repo.
For instance:
VERSION=1.2.0
SOURCE=https://github.com/path-to/project
If the source repo tags newer versions when things change, updating things here can be automated.5
In the long run, it could even be possible to add/update icon-sets here without an intermediary repo, but for now, this is how it is done.
To encode sprite, you can use the command line like:
java -jar plantuml.jar -encodesprite 16z foo.png
wherefoo.png
is the image file you want to use (it will be converted to gray automatically). After-encodesprite
, you have to specify a format:4
,8
,16
,4z
,8z
or16z
. The number indicates the gray level and the optionalz
is used to enable compression in sprite definition.
This blog post by Hubert Klein Ikkink might be of some help
Look at existing sprite sets for inspiration
A good example of this is #18