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

北战南征 提交于 2019-12-10 15:54:06

问题


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:

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>


回答1:


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.




回答2:


I have version 2.28 installed, and my local documentation (C:\Program Files\Graphviz 2.28\share\graphviz\doc\html\info\shapes.html#html) makes no mention of any <I> or <B> tags under the HTML-Like Labels section. It appears that the tags still work when producing png output, but the support was (apparently) either removed from or never added to the svg functionality and is now (apparently) not supported for any output.



来源:https://stackoverflow.com/questions/12770786/graphviz-dot-italic-text-in-html-table-is-non-italic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!