Graphviz: change font for the whole graph?

后端 未结 3 2001
独厮守ぢ
独厮守ぢ 2021-01-31 13:05

I am wondering if I can define an alternative font for the whole graph.

...
digraph script_concept {
graph [layout=\"dot\",fontname=\"helvetica\"];
...
<         


        
3条回答
  •  死守一世寂寞
    2021-01-31 13:59

    However, there's one easy trick, if you are exporting svgs:

    sed 's/Times,serif/Helvetica/g' thegraph.svg > thegraph_helvetica.svg

    combine this with Make and all the horror will be hidden :) here's an example Makefile:

    all: helvetica
    
    svg:
        cat thegraph.dot | dot -Tsvg > thegraph.svg
    helvetica: svg
        sed 's/Times,serif/Helvetica/g' thegraph.svg > thegraph_helvetica.svg
    

提交回复
热议问题