in reply to Automagic text-to-image border calculations

Checkout Imager::Font::Wrap. Might save some time.

Imager::Font will return the size you're looking for with this snippet (from cpan)
$blue = Imager::Color->new("#0000FF"); $font = Imager::Font->new(file => 'pathtofont.ttf', color => $blue, size => 30); ($neg_width, $global_descent, $pos_width, $global_ascent, $descent, $ascent) = $font->bounding_box(string=>"Foo");