<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -15,5 +15,13 @@ Prawn::Document.generate &quot;font_size.pdf&quot;, :page_size =&gt; &quot;A4&quot; do
     text 'Font at 9 point'
   end
   
+  font(&quot;Times-Roman&quot;, :style =&gt; :italic, :size =&gt; 12) do
+    text &quot;Font in times at 12&quot;
+    font.size(16) { text &quot;Font in Times at 16&quot; }
+  end
+  
   text 'Font at 16 point'
-end
+  
+  font &quot;Courier&quot;, :size =&gt; 40
+  text &quot;40 pt!&quot;
+end
\ No newline at end of file</diff>
      <filename>examples/font_size.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,11 @@ module Prawn
     # more portable.
     #
     def font(name=nil, options={}) 
+      if block_given?
+        original_name = font.name
+        original_size = font.size
+      end
+      
       if name     
         if font_families.key?(name)
           ff = name                                                      
@@ -34,7 +39,16 @@ module Prawn
         Prawn::Font.register(&quot;Helvetica&quot;, :for =&gt; self, :family =&gt; &quot;Helvetica&quot;) 
         @font_name = &quot;Helvetica&quot;             
       end  
-      font_registry[@font_name] 
+     
+      font_obj = font_registry[@font_name] 
+      font_obj.size = options[:size] if options[:size]
+      
+      if block_given?
+        yield
+        font(original_name, :size =&gt; original_size)
+      else
+        font_obj
+      end
     end      
        
     # Hash of Font objects keyed by names
@@ -134,7 +148,11 @@ module Prawn
       end  
       
       add_to_current_page    
-    end      
+    end     
+    
+    def inspect
+      &quot;Prawn::Font&lt; #{name}: #{size} &gt;&quot;
+    end
     
     # Sets the default font size for use within a block. Individual overrides
     # can be used as desired. The previous font size will be restored after the</diff>
      <filename>lib/prawn/font.rb</filename>
    </modified>
    <modified>
      <diff>@@ -70,6 +70,28 @@ describe &quot;font style support&quot; do
       
 end
 
+describe &quot;Transactional font handling&quot; do
+  before(:each) { create_pdf }
+  
+  it &quot;should allow setting of size directly when font is created&quot; do
+    @pdf.font &quot;Courier&quot;, :size =&gt; 16
+    @pdf.font.size.should == 16 
+  end
+  
+  it &quot;should allow temporary setting of a new font using a transaction&quot; do
+    original = @pdf.font
+    
+    @pdf.font &quot;Courier&quot;, :size =&gt; 16 do
+      @pdf.font.name.should == &quot;Courier&quot;
+      @pdf.font.size.should == 16
+    end
+    
+    @pdf.font.should == original  
+  end
+  
+end
+
+
 describe &quot;Document#page_fonts&quot; do
   before(:each) { create_pdf } 
   </diff>
      <filename>spec/font_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6ca21044092ec8078a3f63e8b7333999166da992</id>
    </parent>
  </parents>
  <author>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </author>
  <url>http://github.com/sandal/prawn/commit/50e53a09409d600d000d1e4f7b45ba9539138fab</url>
  <id>50e53a09409d600d000d1e4f7b45ba9539138fab</id>
  <committed-date>2008-10-26T10:11:16-07:00</committed-date>
  <authored-date>2008-10-26T10:11:16-07:00</authored-date>
  <message>Add new font features</message>
  <tree>85844d75c18f2732da9040c50dbeff2f46ac381d</tree>
  <committer>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </committer>
</commit>
