<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>examples/alignment.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -41,7 +41,6 @@ module Prawn
       # wanted it usually means the current font doesn't include that character.
       #
       def text(text,options={})
-
         # check the string is encoded sanely
         normalize_encoding(text)
 
@@ -157,7 +156,8 @@ module Prawn
       end
 
       # TODO: Get kerning working with wrapped text
-      def wrapped_text(text,options)
+      def wrapped_text(text,options) 
+        options[:align] ||= :left
         font_size(options[:size] || current_font_size) do
           font_name = font_registry[fonts[@font]]
 
@@ -171,11 +171,22 @@ module Prawn
             move_text_position(@font_metrics.font_height(current_font_size) +
                            @font_metrics.descender / 1000.0 * current_font_size)  
                                
+                           
+            line_width = text_width(e,font_size)
+            case(options[:align]) 
+            when :left
+              x = @bounding_box.absolute_left
+            when :center
+              x = @bounding_box.absolute_left + 
+                (@bounding_box.width - line_width) / 2.0
+            when :right
+              x = @bounding_box.absolute_right - line_width
+            end
                                
             add_content %Q{
               BT
               /#{font_name} #{current_font_size} Tf
-              #{@bounding_box.absolute_left} #{y} Td
+              #{x} #{y} Td
             }    
              
            add_content Prawn::PdfObject(@font_metrics.convert_text(e,options)) &lt;&lt; </diff>
      <filename>lib/prawn/document/text.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>34f1e35fbe793282542243234adb150a8d4c0251</id>
    </parent>
  </parents>
  <author>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </author>
  <url>http://github.com/sandal/prawn/commit/68c7b1347810db4e12bbd6d24f4d306d167151ab</url>
  <id>68c7b1347810db4e12bbd6d24f4d306d167151ab</id>
  <committed-date>2008-07-24T14:42:59-07:00</committed-date>
  <authored-date>2008-07-24T14:42:59-07:00</authored-date>
  <message>And now our text powers have aligned</message>
  <tree>eff8f538c1b18a0c36f7c20d6f11563a31e8246e</tree>
  <committer>
    <name>Gregory Brown</name>
    <email>gregory.t.brown@gmail.com</email>
  </committer>
</commit>
