+
+ { # RT 73359
+ # non-AA font drawing isn't normal mode
+
+ Imager->log("testing no-aa normal output\n");
+
+ my $font = Imager::Font->new(file => "fontfiles/ImUgly.ttf", type => "ft2");
+
+ ok($font, "make a work font");
+
+ my %common =
+ (
+ x => 10,
+ font => $font,
+ size => 25,
+ aa => 0,
+ align => 0,
+ );
+
+ # build our comparison image
+ my $cmp = Imager->new(xsize => 120, ysize => 100);
+ my $layer = Imager->new(xsize => 120, ysize => 100, channels => 4);
+ ok($layer->string(%common, y => 10, text => "full", color => "#8080FF"),
+ "draw non-aa text at full coverage to layer image");
+ ok($layer->string(%common, y => 40, text => "half", color => "#FF808080"),
+ "draw non-aa text at half coverage to layer image");
+ ok($layer->string(%common, y => 70, text => "quarter", color => "#80FF8040"),
+ "draw non-aa text at zero coverage to layer image");
+ ok($cmp->rubthrough(src => $layer), "rub layer onto comparison image");
+
+ my $im = Imager->new(xsize => 120, ysize => 100);
+ ok($im->string(%common, y => 10, text => "full", color => "#8080FF"),
+ "draw non-aa text at full coverage");
+ ok($im->string(%common, y => 40, text => "half", color => "#FF808080"),
+ "draw non-aa text at half coverage");
+ ok($im->string(%common, y => 70, text => "quarter", color => "#80FF8040"),
+ "draw non-aa text at zero coverage");
+ is_image($im, $cmp, "check the result");
+
+ push @test_output, "noaanorm.ppm", "noaacmp.ppm";
+ ok($cmp->write(file => "testout/noaacmp.ppm"), "save cmp image")
+ or diag "Saving cmp image: ", $cmp->errstr;
+ ok($im->write(file => "testout/noaanorm.ppm"), "save test image")
+ or diag "Saving result image: ", $im->errstr;
+ }
+}
+
+Imager->close_log();
+
+END {
+ unless ($ENV{IMAGER_KEEP_FILES}) {
+ unlink map "testout/$_", @test_output;
+ }