Subject: | TT hides FT2 for font type detection |
If ft2 is installed, but not tt, Imager fails to autodetect the font type.
Example code:
my $arial = Imager::Font->new(
file => "arial.ttf",
size => 8,
color => $bg
) or die "Can't load arial.ttf: $Imager::ERRSTR";
Included patch fixes the problem.
Subject: | Philip_Gwyn.Imager.tt-vs-ft2.01.patch |
--- Imager-0.80/lib/Imager/Font.pm 2011-01-14 21:18:44.000000000 -0500
+++ Imager-0.80-PG/lib/Imager/Font.pm 2011-02-02 18:26:01.040530984 -0500
@@ -78,7 +78,7 @@
undef $type;
my $re = $drivers{$drv}{files} or next;
if ($file =~ /$re/i) {
- if (eval { require $drivers{$drv}{module}; 1 }) {
+ if (eval { require $drivers{$drv}{module}; 1 } and !( $drivers{$drv}{checktype} && !$Imager::formats{$drv} )) {
$type = $drv;
last;
}