*** lib/SQL/Translator/Producer/GraphViz.pm.orig	Thu Dec  7 09:05:17 2006
--- lib/SQL/Translator/Producer/GraphViz.pm	Fri Apr  6 14:42:41 2007
***************
*** 88,93 ****
--- 88,118 ----
  
  height (in inches) of the output grahic
  
+ =item * fontsize
+ 
+ custom font size for node and edge labels (note that arbitrarily large
+ sizes may be ignored due to page size or graph size constraints)
+ 
+ ==item * fontname
+ 
+ custom font name (or full path to font file) for node, edge, and graph
+ labels
+ 
+ ==item * nodeattrs
+ 
+ reference to a hash of node attribute names and their values; these
+ may override general fontname or fontsize parameter
+ 
+ ==item * edgeattrs
+ 
+ reference to a hash of edge attribute names and their values; these
+ may override general fontname or fontsize parameter
+ 
+ ==item * graphattrs
+ 
+ reference to a hash of graph attribute names and their values; these
+ may override the general fontname parameter
+ 
  =item * show_fields (DEFAULT: true)
  
  if set to a true value, the names of the colums in a table will
***************
*** 221,226 ****
--- 246,256 ----
                             ? $args->{'width'} : 8.5;
      my $height           = defined $args->{'height'}
                             ? $args->{'height'} : 11;
+     my $fontsize         = $args->{'fontsize'};
+     my $fontname         = $args->{'fontname'};
+     my $edgeattrs        = $args->{'edgeattrs'} || {};
+     my $graphattrs       = $args->{'graphattrs'} || {};
+     my $nodeattrs        = $args->{'nodeattrs'} || {};
      my $show_fields      = defined $args->{'show_fields'} 
                             ? $args->{'show_fields'} : 1;
      my $add_color        = $args->{'add_color'};
***************
*** 262,272 ****
          node          => { 
              shape     => $node_shape, 
              style     => 'filled', 
!             fillcolor => 'white' 
!         }
      );
      $args{'width'}  = $width  if $width;
      $args{'height'} = $height if $height;
  
      my $gv =  GraphViz->new( %args ) or die "Can't create GraphViz object\n";
  
--- 292,331 ----
          node          => { 
              shape     => $node_shape, 
              style     => 'filled', 
!             fillcolor => 'white',
!         },
      );
      $args{'width'}  = $width  if $width;
      $args{'height'} = $height if $height;
+     # set fontsize for edge and node labels if specified
+     if ($fontsize) {
+         $args{'node'}->{'fontsize'} = $fontsize;
+         $args{'edge'} = {} unless $args{'edge'};
+         $args{'edge'}->{'fontsize'} = $fontsize;        
+     }
+     # set the font name globally for node, edge, and graph labels if
+     # specified (use node, edge, or graph attributes for individual
+     # font specification)
+     if ($fontname) {
+         $args{'node'}->{'fontname'} = $fontname;
+         $args{'edge'} = {} unless $args{'edge'};
+         $args{'edge'}->{'fontname'} = $fontname;        
+         $args{'graph'} = {} unless $args{'graph'};
+         $args{'graph'}->{'fontname'} = $fontname;        
+     }
+     # set additional node, edge, and graph attributes; these may
+     # possibly override ones set before
+     while (my ($key,$val) = each %$nodeattrs) {
+         $args{'node'}->{$key} = $val;
+     }
+     $args{'edge'} = {} if %$edgeattrs && !$args{'edge'};
+     while (my ($key,$val) = each %$edgeattrs) {
+         $args{'edge'}->{$key} = $val;
+     }
+     $args{'graph'} = {} if %$edgeattrs && !$args{'graph'};
+     while (my ($key,$val) = each %$graphattrs) {
+         $args{'graph'}->{$key} = $val;
+     }
  
      my $gv =  GraphViz->new( %args ) or die "Can't create GraphViz object\n";
  
