• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/perl
2#
3# Test read image method on TrueType font
4#
5# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us
6#
7
8BEGIN { $| = 1; $test=1; print "1..3\n"; }
9END {print "not ok $test\n" unless $loaded;}
10use Image::Magick;
11$loaded=1;
12
13require 't/subroutines.pl';
14
15chdir 't/ttf' || die 'Cd failed';
16
17#
18# 1) Test default ImageMagick read operation on font
19#
20print("Default ImageMagick read ...\n");
21testReadCompare('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;
29print("Draw text using font ...\n");
30testReadCompare(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;
39print("Draw text using annotate ...\n");
40testFilterCompare('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
511;
52