~ubuntu-branches/ubuntu/intrepid/graphicsmagick/intrepid

« back to all changes in this revision

Viewing changes to PerlMagick/t/ttf/read.t

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2006-05-06 16:28:08 UTC
  • Revision ID: james.westby@ubuntu.com-20060506162808-vt2ni3r5nytcszms
Tags: upstream-1.1.7
ImportĀ upstreamĀ versionĀ 1.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
2
# Copyright (C) 2003 GraphicsMagick Group
 
3
# Copyright (C) 2002 ImageMagick Studio
 
4
# Copyright (C) 1991-1999 E. I. du Pont de Nemours and Company
 
5
#
 
6
# This program is covered by multiple licenses, which are described in
 
7
# Copyright.txt. You should have received a copy of Copyright.txt with this
 
8
# package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
 
9
#
 
10
#
 
11
# Test read image method on TrueType font
 
12
#
 
13
# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us
 
14
#
 
15
 
 
16
BEGIN { $| = 1; $test=1; print "1..3\n"; }
 
17
END {print "not ok $test\n" unless $loaded;}
 
18
use Graphics::Magick;
 
19
$loaded=1;
 
20
 
 
21
require 't/subroutines.pl';
 
22
 
 
23
chdir 't/ttf' || die 'Cd failed';
 
24
 
 
25
#
 
26
# 1) Test default ImageMagick read operation on font
 
27
#
 
28
print("Default ImageMagick read ...\n");
 
29
testReadCompare('input.ttf', '../reference/ttf/read.miff',
 
30
                q/size=>'512x512', depth=>8/,
 
31
                0.001, 0.004);
 
32
 
 
33
#
 
34
# 2) Test drawing text using font
 
35
#
 
36
++$test;
 
37
print("Draw text using label: ...\n");
 
38
testReadCompare(q!label:The quick brown fox jumps over the lazy dog.!,
 
39
                q!../reference/ttf/label.miff!,
 
40
                q!font=>'input.ttf', fill=>'#0000FF', pointsize=>14, size=>'245x16', depth=>8!,
 
41
                0.0001, 0.004);
 
42
 
 
43
#
 
44
# 3) Test drawing text using annotate
 
45
#
 
46
++$test;
 
47
print("Draw text using annotate ...\n");
 
48
testFilterCompare('xc:#FFFFFF',
 
49
                  q!size=>'250x20', depth=>8!,
 
50
                  q!../reference/ttf/annotate.miff!,
 
51
                  'Annotate',
 
52
                  q!text=>'The quick brown fox jumps over the lazy dog.',
 
53
                  gravity=>'NorthWest',
 
54
                  geometry=>'+6+14',
 
55
                  font=>'input.ttf',
 
56
                  fill=>'#FF0000',
 
57
                  pointsize=>14!,
 
58
                  0.0001, 0.004);
 
59
1;