Open mojavelinux opened 9 years ago
@mojavelinux I can give this a try, but I'm not sure if all the diagram types are going to be able to support this. I'll start by compiling a list of mappings for this attribute per diagram type.
-f
command line option.graph
, node
and edge
entries and add [fontname = "..."]
attributes. See http://stackoverflow.com/questions/10879115/graphviz-change-font-for-the-whole-graphfont
attribute.skinparam defaultFontName #{fontname}
at the beginning of the diagram code.*
style definition. Font needs to be in [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]
format:+1: The best approach seems to be to start with the diagram engines that support it so we can feel out how it will work. Then we can add them in as those engines permit.
@mojavelinux based on my initial research, this is not going to be easy for most diagram types. Meme and ditaa are straightforward, but the others adding or modifying content in the diagram code.
Perhaps supporting attribute substitutions in the diagram code would be the easier way to do this. You would still have to repeat the attribute ref in each diagram, but at least you can control the font globally then by changing a single attribute value.
Thanks for digging into this. I'd say that the goal here isn't to make the tools do something they can't but to activate the feature in tools that do. So the focus is really meme and ditaa, and maybe plantuml if there is a way to somehow inject that information into the diagram output (in the case of SVG).
It would be nice if it were possible to specify the font used in diagrams (for instance, in salt file trees).
This definitely isn't something we should encourage at the block-level since it mixes content and presentation. We could, however, allow document-level attributes to be used, such as:
Another option is to consider having a configuration file for Asciidoctor Diagram in which we can put all diagram-related options. For instance, it might be nice to be able to customize the look and feel of various types of nodes. Too much of this in the AsciiDoc document and it gets cluttered.