No such thing as a small change | |
PerlMonks |
Re: Centering Text with GD::Imageby Fletch (Bishop) |
on Nov 03, 2021 at 19:45 UTC ( [id://11138405]=note: print w/replies, xml ) | Need Help?? |
Prossibly you could use GD::Text::Wrap and/or reimplement what it does (which looks to be what I vaguely recall was the unfortunatly kludgy procedure: draw (but don't really draw) the text into a test image and then ask for the bounds afterwards). Edit: Actually I think I'm misremembering something from ancient PostScript where that was the way to get the bounding box. Other answers using the font info are much better.
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|