bollenberger/fpdf — pull request #1 by jhbadger (2013-04-12 17:49:51+00:00)
Title: Fix for string/integer conversion att line 782 in fpdf.rb for ruby 1.9/2.0

I have noticed a problem using fpdf under ruby 1.9.3 and 2.0. Specifically, I get an error at line 782 like so:

/Users/jbadger/.rvm/gems/ruby-1.9.3-head/gems/fpdf-1.53/lib/fpdf.rb:782:in `[]': can't convert String into Integer (TypeError)
from /Users/jbadger/.rvm/gems/ruby-1.9.3-head/gems/fpdf-1.53/lib/fpdf.rb:782:in `Write'

I find that I can fix this if the line at 782 is changed from:
l=l+cw[c];
to
l=l+cw[c.to_i];

As far as I can tell, this doesn't hurt it under 1.8.7, but allows it to run under 1.9.3 and 2.0 as well.

Thanks,
Jonathan