Diff for /loncom/xml/lonplot.pm between versions 1.123 and 1.124

version 1.123, 2007/08/03 06:00:18 version 1.124, 2007/08/03 06:08:06
Line 703  my %font_properties = Line 703  my %font_properties =
      );       );
   
 sub get_font {  sub get_font {
       my ($target) = @_;
     my ($size, $selected_font);      my ($size, $selected_font);
   
     if ( $Apache::lonplot::plot{'font'} =~ /^(small|medium|large)/) {      if ( $Apache::lonplot::plot{'font'} =~ /^(small|medium|large)/) {
Line 720  sub get_font { Line 721  sub get_font {
  $size = $Apache::lonplot::plot{'font'};   $size = $Apache::lonplot::plot{'font'};
  $selected_font = $font_properties{$Apache::lonplot::plot{'fontface'}};   $selected_font = $font_properties{$Apache::lonplot::plot{'fontface'}};
     }      }
       if ($target eq 'tex' && defined($Apache::lonplot::plot{'texfont'})) {
    $size = $Apache::lonplot::plot{'texfont'};
       }
     return ($size, $selected_font);      return ($size, $selected_font);
 }  }
   
Line 1117  sub get_attributes{ Line 1121  sub get_attributes{
 ##------------------------------------------------------- write_gnuplot_file  ##------------------------------------------------------- write_gnuplot_file
 sub write_gnuplot_file {  sub write_gnuplot_file {
     my ($tmpdir,$filename,$target)= @_;      my ($tmpdir,$filename,$target)= @_;
     my ($fontsize, $font_properties) =  &get_font();      my ($fontsize, $font_properties) =  &get_font($target);
     my $gnuplot_input = '';      my $gnuplot_input = '';
     my $curve;      my $curve;
     my $pt = $Apache::lonplot::plot{'texfont'};  
     #      #
     # Check to be sure we do not have any empty curves      # Check to be sure we do not have any empty curves
     my @curvescopy;      my @curvescopy;
Line 1234  sub write_gnuplot_file { Line 1237  sub write_gnuplot_file {
     # title, xlabel, ylabel      # title, xlabel, ylabel
     # titles      # titles
     if ($target eq 'tex') {      if ($target eq 'tex') {
  $gnuplot_input .= "set title  \"$title\"  font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($title)) ;   $gnuplot_input .= "set title  \"$title\"  font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($title)) ;
  $gnuplot_input .= "set xlabel \"$xlabel\" font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($xlabel));   $gnuplot_input .= "set xlabel \"$xlabel\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($xlabel));
  $gnuplot_input .= "set ylabel \"$ylabel\" font \"".$font_properties->{'printname'}.",".$pt."pt\"\n" if (defined($ylabel));   $gnuplot_input .= "set ylabel \"$ylabel\" font \"".$font_properties->{'printname'}.",".$fontsize."pt\"\n" if (defined($ylabel));
     } else {      } else {
         $gnuplot_input .= "set title  \"$title\"  \n" if (defined($title)) ;          $gnuplot_input .= "set title  \"$title\"  \n" if (defined($title)) ;
         $gnuplot_input .= "set xlabel \"$xlabel\" \n" if (defined($xlabel));          $gnuplot_input .= "set xlabel \"$xlabel\" \n" if (defined($xlabel));
Line 1284  sub write_gnuplot_file { Line 1287  sub write_gnuplot_file {
  $gnuplot_input .= 'set label "'.$label->{'text'}.'" at '.   $gnuplot_input .= 'set label "'.$label->{'text'}.'" at '.
     $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'};      $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'};
         if ($target eq 'tex') {          if ($target eq 'tex') {
     $gnuplot_input .=' font "'.$font_properties->{'printname'}.','.$pt.'pt"' ;      $gnuplot_input .=' font "'.$font_properties->{'printname'}.','.$fontsize.'pt"' ;
         }          }
         $gnuplot_input .= $/;          $gnuplot_input .= $/;
     }      }

Removed from v.1.123  
changed lines
  Added in v.1.124


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>