asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
431 stars 106 forks source link

Allow the diagram font to be specified #70

Open mojavelinux opened 9 years ago

mojavelinux commented 9 years ago

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:

:diagram-font-family: Noto Sans

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.

pepijnve commented 8 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.

mojavelinux commented 8 years ago

:+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.

pepijnve commented 8 years ago

@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.

mojavelinux commented 8 years ago

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).