Home | History | Annotate | Download | only in ttf
      1 #!/usr/bin/perl
      2 #
      3 # Test read image method on TrueType font
      4 #
      5 # Contributed by Bob Friesenhahn <bfriesen (at] simple.dallas.tx.us
      6 #
      7 
      8 BEGIN { $| = 1; $test=1; print "1..3\n"; }
      9 END {print "not ok $test\n" unless $loaded;}
     10 use Image::Magick;
     11 $loaded=1;
     12 
     13 require 't/subroutines.pl';
     14 
     15 chdir 't/ttf' || die 'Cd failed';
     16 
     17 #
     18 # 1) Test default ImageMagick read operation on font
     19 #
     20 print("Default ImageMagick read ...\n");
     21 testReadCompare('input.ttf', '../reference/ttf/read.miff',
     22                 q/size=>'512x512', depth=>8/,
     23                 0.14, 1.01);
     24 
     25 #
     26 # 2) Test drawing text using font
     27 #
     28 ++$test;
     29 print("Draw text using font ...\n");
     30 testReadCompare(q!label:The quick brown fox jumps over the lazy dog.!,
     31                 q!../reference/ttf/label.miff!,
     32                 q!font=>'input.ttf', fill=>'#0000FF', pointsize=>14, size=>'245x16', depth=>8!,
     33                 0.14, 1.01);
     34 
     35 #
     36 # 3) Test drawing text using annotate
     37 #
     38 ++$test;
     39 print("Draw text using annotate ...\n");
     40 testFilterCompare('xc:#FFFFFF',
     41                   q!size=>'250x20', depth=>8!,
     42                   q!../reference/ttf/annotate.miff!,
     43                   'Annotate',
     44                   q!text=>'The quick brown fox jumps over the lazy dog.',
     45                   geometry=>'+6+14',
     46                   font=>'input.ttf',
     47                   fill=>'#FF0000',
     48                   pointsize=>14!,
     49                   0.14, 1.01);
     50 
     51 1;
     52