web-dev-qa-db-ja.com

graphvizのデフォルトのフォントサイズを変更する方法は?

コードの文書化にはdoxygen + graphvizを使用しています。 graphvizは画像を生成する素晴らしい仕事をします。

Graphvizのデフォルトのフォントサイズを変更する方法はありますか?デフォルトは14ですが、代わりに12を使用したいと思います。

ノード、サブグラフ、エッジなどの個々の要素のフォントサイズを変更するのは本当に苦痛です。

更新:

参考までに、私がdoxygenで使用しているコードを示します(もちろん、テキストフィールドの名前は変更されています)

@dot
 strict digraph {
   node [shape = box, fontsize = 12];
     subgraph cluster_main {
       fontsize = 12;
       shape    = box;
       label    = "main";
       subgraph cluster_main_common {
         fontsize = 12;
         shape    = box;
         label    = "common";
         subgraph cluster_main_common_source {
           fontsize = 12;
           shape    = box;
           label    = "source"
           subgraph cluster_file1 {
             fontsize = 12;
             shape    = box;
             label    = "file1.c";
             gSystem [label = "var1" URL = "\ref var1"];
           }
           subgraph cluster_file2 {
             fontsize = 12;
             shape    = box;
             label    = "file2.c";
             gCard [label = "var2" URL = "\ref var2"];
           }
           subgraph cluster_file3 {
             fontsize = 12;
             shape    = box;
             label    = "file3.c";
             gPwrSupply [label = "var3" URL = "\ref var3"];
           }
         }
       }
       subgraph cluster_main_docs {
         fontsize = 12;
         shape    = box;
         label    = "docs";
         subgraph cluster_main_docs_features {
           fontsize = 12;
           shape    = box;
           label    = "features";
           subgraph cluster_main_docs_features_source {
             fontsize = 12;
             shape    = box;
             label    = "source"
             subgraph cluster_file4 {
               fontsize = 12;
               shape    = box;
               label    = "file4.c";
               deviceInfo [label = "var4" URL = "\ref var4"];
             }
           }
         }
       }
     }
   }
   @enddot
25
chronodekar

Fontsizeは、グラフ属性(およびエッジ属性とノード属性)です。 Doxygenはドットファイルを生成するため、例:

strict digraph {
                 graph [ bgcolor=lightgray, resolution=128, fontname=Arial, fontcolor=blue, 
                         fontsize=12 ];
                 node [ fontname=Arial, fontcolor=blue, fontsize=11];
                 Edge [ fontname=Helvetica, fontcolor=red, fontsize=10 ];

                }

特定の設定は一般的な設定を上書きします。したがって、fontsizeをノード属性として設定すると、グラフ属性として設定されたfontsizeがオーバーライドされ(ただし、ノードの場合のみ)、特定のノードにfontsizeを設定すると、すべてのノードに設定されたfontsizeがオーバーライドされます。

上記のものを試してもうまくいかない場合は、fontsizeを変更し、ドットファイル全体で「fontsize」設定を検索して削除し、fontsizeをノード属性として再設定します。

これが完全なgraphviz 属性リスト です。

42
doug