# Font issue with html like label

**URL:** <https://forum.graphviz.org/t/font-issue-with-html-like-label/1893>\
**Category:** Help\
**Created:** [November 25, 2023, 3:14pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893 "2023-11-25T15:14:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrnilsson](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mrnilsson](https://forum.graphviz.org/u/mrnilsson)\
**Post date:** [November 25, 2023, 3:14pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/1 "2023-11-25T15:14:01Z")

</div>

I’m trying to make a html like label with a font face, different from the standard one. How can I make it display correctly?

```auto
digraph top {
    compound=true
    node[shape=record]
    i [label=<<TABLE CELLSPACING="5" CELLPADDING="4" BORDER="0" CELLBORDER="1">
    <TR>
      <TD>a very long label</TD>
    </TR>  
    <TR>
      <TD>b</TD>
    </TR>  
    <TR>
      <TD>c</TD>
    </TR>  
    <TR>
      <TD>d</TD>
    </TR>  
    </TABLE>> style="dotted" fontname="Monospace" fontsize="10pt"]

    p->i:w
    
    rankdir=LR
}

```

[Rendered by magjac.com/graphviz-visual-editor/](http://magjac.com/graphviz-visual-editor/?dot=digraph%20top%20%7B%0A%20%20%20%20compound%3Dtrue%0A%20%20%20%20node%5Bshape%3Drecord%5D%0A%20%20%20%20i%20%5Blabel%3D%3C%3CTABLE%20CELLSPACING%3D%225%22%20CELLPADDING%3D%224%22%20BORDER%3D%220%22%20CELLBORDER%3D%221%22%3E%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ea%20very%20long%20label%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Eb%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ec%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ed%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3C%2FTABLE%3E%3E%20style%3D%22dotted%22%20fontname%3D%22Monospace%22%20fontsize%3D%2210pt%22%5D%0A%0A%20%20%20%20p-%3Ei%3Aw%0A%20%20%20%20%0A%20%20%20%20rankdir%3DLR%0A%7D%0A)

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [November 25, 2023, 3:30pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/2 "2023-11-25T15:30:26Z")

</div>

Use \<FONT …\> (see [Node Shapes | Graphviz](https://graphviz.org/doc/info/shapes.html#fonts-example))

A variant of what you want:

```auto
digraph top {
    compound=true
    node[shape=record]
    i [label=<<TABLE CELLSPACING="5" CELLPADDING="4" BORDER="0" CELLBORDER="1">
    <TR>
      <TD><FONT POINT-SIZE="24" FACE="Monospace">a very long label</FONT></TD>
    </TR>  
    <TR>
      <TD><FONT POINT-SIZE="18" FACE="Times-Roman">b</FONT></TD>
    </TR>  
    <TR>
      <TD>c</TD>
    </TR>  
    <TR>
      <TD>d</TD>
    </TR>  
    </TABLE>> style="dotted" ]

    p->i:w
    
    rankdir=LR
}

```

Giving:  
 ![htmlFont1.](https://global.discourse-cdn.com/graphviz/original/2X/6/6dcbae7b4302ca54c799938f7ee0eec50befcd69.png)

---

<div class="post-metadata">

**Author:** ![mrnilsson](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mrnilsson](https://forum.graphviz.org/u/mrnilsson)\
**Post date:** [November 25, 2023, 3:36pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/3 "2023-11-25T15:36:16Z")

</div>

When I render it at [Graphviz Visual Editor](http://magjac.com/graphviz-visual-editor/?dot=digraph%20top%20%7B%0A%20%20%20%20compound%3Dtrue%0A%20%20%20%20node%5Bshape%3Drecord%5D%0A%20%20%20%20i%20%5Blabel%3D%3C%3CTABLE%20CELLSPACING%3D%225%22%20CELLPADDING%3D%224%22%20BORDER%3D%220%22%20CELLBORDER%3D%221%22%3E%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3E%3CFONT%20POINT-SIZE%3D%2224%22%20FACE%3D%22Monospace%22%3Ea%20very%20long%20label%3C%2FFONT%3E%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3E%3CFONT%20POINT-SIZE%3D%2218%22%20FACE%3D%22Times-Roman%22%3Eb%3C%2FFONT%3E%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ec%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ed%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3C%2FTABLE%3E%3E%20style%3D%22dotted%22%20%5D%0A%0A%20%20%20%20p-%3Ei%3Aw%0A%20%20%20%20%0A%20%20%20%20rankdir%3DLR%0A%7D), this becomes the same. With what did you render it?

---

<div class="post-metadata">

**Author:** ![mrnilsson](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mrnilsson](https://forum.graphviz.org/u/mrnilsson)\
**Post date:** [November 25, 2023, 3:45pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/4 "2023-11-25T15:45:00Z")

</div>

With what did you render it? This becomes the same at magjac when I render it there.

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [November 25, 2023, 5:46pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/5 "2023-11-25T17:46:47Z")

</div>

A guess: this may be a “Font Problem” ([Font FAQ | Graphviz](https://graphviz.org/faq/font/)). The on-line renderer does not seem to give any error messages if you enter gibberish for a font name, it just falls back to a known font. So maybe it can’t find your desired fonts.

Try **courier**. If it works, try other alternatives.

I rendered the above on my Linux system.  
But I just created this on my Windows system & [Graphviz Visual Editor](http://magjac.com/graphviz-visual-editor/)

```auto
digraph top {
    compound=true
    node[shape=record]
    i [label=<<TABLE CELLSPACING="5" CELLPADDING="4" BORDER="0" CELLBORDER="1">
    <TR>
      <TD>a very long label</TD>
    </TR>  
    <TR>
      <TD>b</TD>
    </TR>  
    <TR>
      <TD>c</TD>
    </TR>  
    <TR>
      <TD><FONT POINT-SIZE="24" FACE="AvantGarde-DemiOblique">a very long label</FONT></TD>
    </TR>  
    </TABLE>> style="dotted" ]

    p->i:w
    
    rankdir=LR
}

```

![Untitled Graph 29](https://global.discourse-cdn.com/graphviz/original/2X/d/d71e43a8c51864bd35b4770c696eb3a28b072b62.png)

---

<div class="post-metadata">

**Author:** ![magjac](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/magjac/32/16_2.png) [@magjac](https://forum.graphviz.org/u/magjac)\
**Post date:** [November 25, 2023, 9:06pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/6 "2023-11-25T21:06:42Z")

</div>

Steve is correct. It’s a font problem. Your browser may not have the default font. I usually use Helvetica. See [this modification of your example](http://magjac.com/graphviz-visual-editor/?dot=digraph%20top%20%7B%0A%20%20%20%20compound%3Dtrue%0A%20%20%20%20node%5Bshape%3Drecord%5D%0A%20%20%20%20i%20%5Blabel%3D%3C%3CTABLE%20CELLSPACING%3D%225%22%20CELLPADDING%3D%224%22%20BORDER%3D%220%22%20CELLBORDER%3D%221%22%3E%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%3CFONT%20FACE%3D%22Helvetica%22%3Ea%20very%20long%20label%3C%2FFONT%3E%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Eb%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ec%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3Ed%3C%2FTD%3E%0A%20%20%20%20%3C%2FTR%3E%20%20%0A%20%20%20%20%3C%2FTABLE%3E%3E%20style%3D%22dotted%22%20fontname%3D%22Monospace%22%20fontsize%3D%2210pt%22%5D%0A%0A%20%20%20%20p-%3Ei%3Aw%0A%20%20%20%20%0A%20%20%20%20rankdir%3DLR%0A%7D%0A).

---

<div class="post-metadata">

**Author:** ![mrnilsson](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mrnilsson](https://forum.graphviz.org/u/mrnilsson)\
**Post date:** [November 25, 2023, 10:39pm UTC](https://forum.graphviz.org/t/font-issue-with-html-like-label/1893/7 "2023-11-25T22:39:14Z")

</div>

Thank you for working this out. It worked with my own Linux box, so the problem is solved!
