Node and edge labels may be marked up to be drawn with multiple fonts.
The value of the font.multi
property may be set to 'html'
, 'markdown'
or a boolean.
Embedded Font Markup | |||
---|---|---|---|
font mod | font.multi setting | ||
'html' or true | 'markdown' or 'md' | false | |
bold | <b> ... </b> | * ... * | n/a |
italic | <i> ... </i> | _ ... _ | n/a |
mono-spaced | <code> ... </code> | ` ... ` | n/a |
The html
and markdown
rendering is limited: bolds may be embedded in italics, italics may be embedded in bolds, and mono-spaced may be embedded in bold or italic, but will not be altered by those font mods, nor will embedded bolds or italics be handled.
The only entities that will be observed in html are <
and &
and in markdown
a backslash will escape the following character (including a backslash) from special processing.
Any font mod that is started in a label line will be implicitly terminated at the end of that line.
While this interpretation may not exactly match official rendering standards, it is a consistent compromise for drawing multifont strings in the non-multifont html canvas element underlying vis.
This implies that four additional sets of font properties will be recognized in label processing.
font.bold
designates the font used for rendering bold font mods.
font.ital
designates the font used for rendering italic font mods.
font.boldital
designates the font used for rendering bold-and-italic font mods.
font.mono
designates the font used for rendering monospaced font mods.
Any font mod without a matching font will be rendered using the normal font
(or default) value.
The font.multi
and extended font settings may be set in the network's nodes
or edges
properties, or on individual nodes and edges.
Node and edge label fonts are separate.