Search code examples
svggraphvizdotitalic

Graphviz dot - Italic text in HTML table is non-italic


I'm using dot version 2.26.3

The following .dot contents:

digraph html {
results [shape=none, margin=0, label=<
    <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD>Title</TD>
    </TR>
    <TR>
    <TD><I>Description.</I></TD>
    </TR>
    </TABLE>
>];
}

..should produce a non-italic 'Title' and italic 'Description' when generating an SVG according to the documentation.

dot -Tsvg filename.dot -o output/filename.svg

However, the description is non-italic as you can see:

enter image description here

Any idea why?

UPDATE

I couldn't get the latest version installed for various reasons. In the end I remedied by using an italicised font. Equally, you could use a strong font as an equivalent for bold.

<TD><FONT FACE="Times-Roman">Standard.</FONT></TD>

<TD><FONT FACE="Times-Italic">In italics.</FONT></TD>

<TD><FONT FACE="Times-Bold">In bold.</FONT></TD>


Solution

  • Here's why - from the link to the documentation you provided:

    The font markups for bold, italic, underlining, subscript and superscript (<B>, <I>, <U>, <SUB>; and <SUP>) are only available in versions after 14 October 2011, and are currently only available via the cairo and svg renderers

    Version 2.26.3 however seems to be from January 2010 - at least when checking the dates of the downloads for ubuntu or windows.

    I recommend to upgrade.