I'm getting "Could not find/open font" errors when doing anything with graphviz. I've been narrowing it down to an as simple graph as possible, in the file simplest.dot
:
digraph G {
node1
}
When running $ dot simplest.dot -Tpng -O
the graph is rendered to simplest.dot.png
, but I always get this error: Error: Could not find/open font
, and the font used in the output isn't very pretty.
According to the graphviz faq, when this error occurs, you can tell graphviz where to look for fonts. I've been looking around for fonts on the system I'm using, and there seem to be some TrueType fonts in /usr/share/fonts
, among others, the Bitstream Vera fonts, which seem to live in /usr/share/fonts/bitstream-vera
.
So I've tried setting fontpath
and fontname
in the dot graph, to help graphviz figure things out:
digraph G {
fontpath="/usr/share/fonts/bitstream-vera"
fontname="Bitstream Vera Sans"
node1
}
But I'm still getting the exact same error. I've tried several variations of the path and font name, but I can't seem to get it right. What am I doing wrong?