File: fi04pages.t

package info (click to toggle)
libpostscript-file-perl 1.05-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 216 kB
  • ctags: 84
  • sloc: perl: 2,037; makefile: 7
file content (54 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use strict;
use warnings;

use Test;
use charnames qw(:full);
BEGIN { plan tests => 4 };
use PostScript::File qw(check_file incpage_label incpage_roman);

my $hash = { headings => 1,
	     paper => 'US-Letter',
	     errors => 1,
	     debug => 2,
	     page => "viii",
	     incpage_handler => \&incpage_roman,
	     reencode => "ISOLatin1Encoding",
	     fontsuffix => "-latin1",
	     };
my $ps = new PostScript::File( $hash );
ok($ps); # object created

my $label = $ps->get_page_label();
ok($label, "viii");
$ps->add_to_page( <<END_PAGE1 );
    [ (This is page $label) ] db_print
    /Helvetica-latin1 findfont 
    12 scalefont 
    setfont
    172 400 moveto
    (First page) show
END_PAGE1

$ps->newpage();
$label = $ps->get_page_label();
ok($label, "ix");
my $msg = "Second Page: \N{LATIN SMALL LETTER E WITH CIRCUMFLEX} ";
$ps->add_to_page( <<END_PAGE2 );
    [ (This is page $label) ] db_print
    /Times-BoldItalic-latin1 findfont 
    12 scalefont 
    setfont
    172 400 moveto
    ($msg) show
END_PAGE2

my $name = "fi04pages";
$ps->output( $name, "test-results" );
my $file = check_file( "$name.ps", "test-results" );
ok(-e $file);

__END__