Subject: | Imager::Font::Wrap |
Date: | Thu, 25 Jul 2013 23:40:44 -0500 |
To: | bug-Imager [...] rt.cpan.org |
From: | JT Smith <jt [...] plainblack.com> |
I'm not sure if the documentation is wrong, or the code is wrong, but they are out of sync.
If you call wrap_text() without an image reference it returns nothing. So you have to create a temporary image in order to actually precalc the left, top, right, bottom params.
However, the docs indicate you can do the precalc without passing an image reference:
You can use this to calculate the space required to format the text before doing it:
my ($left, $top, $right, $bottom) =
Imager::Font::Wrap->wrap_text(string => $string,
font => $font,
width => $xsize);