[LON-CAPA-cvs] cvs: loncom(settable) /interface lonprintout.pm

foxr foxr@source.lon-capa.org
Wed, 17 Jun 2009 10:21:33 -0000


foxr		Wed Jun 17 10:21:33 2009 EDT

  Modified files:              (Branch: settable)
    /loncom/interface	lonprintout.pm 
  Log:
  Start inserting support for settable font size setting.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.554 loncom/interface/lonprintout.pm:1.554.2.1
--- loncom/interface/lonprintout.pm:1.554	Tue Jun  2 12:20:14 2009
+++ loncom/interface/lonprintout.pm	Wed Jun 17 10:21:33 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.554 2009/06/02 12:20:14 bisitz Exp $
+# $Id: lonprintout.pm,v 1.554.2.1 2009/06/17 10:21:33 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -70,6 +70,10 @@
 my $ssi_retry_count = 5;	# Some arbitrary value.
 
 
+#  Font size:
+
+my $font_size = 'normalsize';	# Default is normalsize...
+
 
 # Fetch the contents of a resource, uninterpreted.
 # This is used here to fetch a latex file to be included
@@ -114,6 +118,24 @@
     return $result;
 }
 
+#
+#   Set a global document font size:
+#   This is done by replacing \begin{document}
+#   with \begin{document}{\some-font-directive
+#   and \end{document} with
+#   }\end{document
+#
+sub set_font_size {
+
+    my ($text) = @_;
+
+    $text =~ s/\\begin{document}/\\begin{document}{\\$font_size/;
+    $text =~ s/\\end{document}/}\\end{document}/;
+    return $text;
+
+
+}
+
 # include_pdf - PDF files are included into the 
 # output as follows:
 #  - The PDF, if necessary, is replicated.
@@ -2222,6 +2244,11 @@
 	    $URLback=~s|^/~|/priv/|;
 	}
     }
+    #
+    # Final adjustment of the font size:
+    #
+
+    $result = set_font_size($result);
 
 #-- writing .tex file in prtspool 
     my $temp_file;