Imager - Re: Font Transformations

Posted on Wed Aug 9 13:18:52 2006 by tonyc in response to 2764 (See the whole thread of 2)
Re: Font Transformations
Yes, it can.

What's probably happened is you're using the FT 1.x driver, which doesn't support transformations, since that's the default for TTF fonts in Imager for historical reasons.

To use the freetype 2.x driver either supply type=>"ft2" to Imager::Font->new or call the priorities class method to make Freetype 2.x the first driver checked.

# either my $font = Imager::Font->new(file => "Arial.ttf", type => "ft2"); # or Imager::Font->priorities(qw/ft2 t1 tt/); my $font = Imager::Font->new(file => "Arial.ttf"); # and now tranform will work use Imager::Matrix2d ':handy'; $font->transform(matrix => m2d_rotate(degrees => 45)); $im->string(font => $font, string => "Slanted text", ...);
Write a response