<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+v0.2.1 (18th November 2008)
+- Small bugfix to prevent unnecesary STDERR output by pango
+
 v0.2.0 (15th September 2008)
 - API INCOMPATIBLE CHANGE: render() and render_file() are now deprecated.
   - Use the output parameter of the constructor instead</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ require 'rake/testtask'
 require &quot;rake/gempackagetask&quot;
 require 'spec/rake/spectask'
 
-PKG_VERSION = &quot;0.2.0&quot;
+PKG_VERSION = &quot;0.2.1&quot;
 PKG_NAME = &quot;pdf-wrapper&quot;
 PKG_FILE_NAME = &quot;#{PKG_NAME}-#{PKG_VERSION}&quot;
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -84,15 +84,20 @@ module PDF
       # TODO: when calculating the min cell width, we basically want the width of the widest character. At the
       #       moment I'm stripping all pango markup tags from the string, which means if any character is made
       #       intentioanlly large, we'll miss it and it might not fit into our table cell.
-      # TODO: allow column widths to be set manually
 
       # calculate the min and max width of every cell in the table
       t.cells.each_with_index do |row, row_idx|
         row.each_with_index do |cell, col_idx|
           opts = t.options_for(col_idx, row_idx).only(default_text_options.keys)
           padding = opts[:padding] || 3
-          cell.min_width  = text_width(cell.data.to_s.dup.gsub(/&lt;.+?&gt;/,&quot;&quot;).gsub(/\b|\B/,&quot;\n&quot;), opts) + (padding * 4)
-          cell.max_width  = text_width(cell.data, opts) + (padding * 4)
+          if opts[:markup] == :pango
+            str = cell.data.to_s.dup.gsub(/&lt;.+?&gt;/,&quot;&quot;).gsub(&quot;&amp;amp;&quot;,&quot;&amp;&quot;).gsub(&quot;&amp;lt;&quot;,&quot;&lt;&quot;).gsub(&quot;&amp;gt;&quot;,&quot;&gt;&quot;)
+            opts.delete(:markup)
+          else
+            str = cell.data.to_s.dup
+          end
+          cell.min_width  = text_width(str.gsub(/\b|\B/,&quot;\n&quot;), opts) + (padding * 4)
+          cell.max_width  = text_width(str, opts) + (padding * 4)
         end
       end
 
@@ -101,15 +106,21 @@ module PDF
         t.headers.each_with_index do |cell, col_idx|
           opts = t.options_for(col_idx, :headers).only(default_text_options.keys)
           padding = opts[:padding] || 3
-          cell.min_width  = text_width(cell.data.to_s.dup.gsub(/&lt;.+?&gt;/,&quot;&quot;).gsub(/\b|\B/,&quot;\n&quot;), opts) + (padding * 4)
-          cell.max_width  = text_width(cell.data, opts) + (padding * 4)
+          if opts[:markup] == :pango
+            str = cell.data.to_s.dup.gsub(/&lt;.+?&gt;/,&quot;&quot;).gsub(&quot;&amp;amp;&quot;,&quot;&amp;&quot;).gsub(&quot;&amp;lt;&quot;,&quot;&lt;&quot;).gsub(&quot;&amp;gt;&quot;,&quot;&gt;&quot;)
+            opts.delete(:markup)
+          else
+            str = cell.data.to_s.dup
+          end
+          cell.min_width  = text_width(str.gsub(/\b|\B/,&quot;\n&quot;), opts) + (padding * 4)
+          cell.max_width  = text_width(str, opts) + (padding * 4)
         end
       end
 
       # let the table decide on the actual widths it will use for each col
       t.calc_col_widths!
 
-      # now that we know how wide each column will be, we can calculate the 
+      # now that we know how wide each column will be, we can calculate the
       # height of every cell in the table
       t.cells.each_with_index do |row, row_idx|
         row.each_with_index do |cell, col_idx|</diff>
      <filename>lib/pdf/wrapper/table.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aca88c0562ed0b0348181ee3bdd97a3807c37066</id>
    </parent>
  </parents>
  <author>
    <name>James Healy</name>
    <email>jimmy@deefa.com</email>
  </author>
  <url>http://github.com/yob/pdf-wrapper/commit/e2b1651d3b8b2ea023aa7c07c064b37c92a59d49</url>
  <id>e2b1651d3b8b2ea023aa7c07c064b37c92a59d49</id>
  <committed-date>2008-11-17T06:31:52-08:00</committed-date>
  <authored-date>2008-11-17T06:31:52-08:00</authored-date>
  <message>Prevent unnecesary output to STDERR by pango
- when calculating the min width of each table column cell, we
  essentailly want the width of the widest character. When I split the
  string into chars, I needed to leave the pango markup entities entact,
  otherwise I was trying to add plain ampersands to the layout that
  calculates the width</message>
  <tree>76f07a7abbf9aceef477c238aad3d6fae2ced7cd</tree>
  <committer>
    <name>James Healy</name>
    <email>jimmy@deefa.com</email>
  </committer>
</commit>
