From 6e56e6082f85179647e9595bfaf8ad1acbe6cf6a Mon Sep 17 00:00:00 2001 From: Jun Kuriyama Date: Mon, 3 Nov 2003 09:00:49 +0000 Subject: Upgrade to 0.71. --- japanese/p5-PDFJ/Makefile | 4 +- japanese/p5-PDFJ/distinfo | 2 +- japanese/p5-PDFJ/files/patch-Object.pm | 10 -- japanese/p5-PDFJ/files/patch-PDFJ.pm | 233 ++++++++++----------------------- japanese/p5-PDFJ/pkg-plist | 2 + 5 files changed, 72 insertions(+), 179 deletions(-) delete mode 100644 japanese/p5-PDFJ/files/patch-Object.pm (limited to 'japanese') diff --git a/japanese/p5-PDFJ/Makefile b/japanese/p5-PDFJ/Makefile index 3c0c7e029a2b..01ecbbb31460 100644 --- a/japanese/p5-PDFJ/Makefile +++ b/japanese/p5-PDFJ/Makefile @@ -6,8 +6,7 @@ # PORTNAME= PDFJ -PORTVERSION= 0.6 -PORTREVISION= 1 +PORTVERSION= 0.71 CATEGORIES= japanese perl5 MASTER_SITES= http://hp1.jonex.ne.jp/%7Enakajima.yasushi/archives/ @@ -17,6 +16,7 @@ COMMENT= PDFJ module provides methods to generate Japanese PDF file USE_ZIP= YES PERL_CONFIGURE= YES WRKSRC= ${WRKDIR} +EXTRACT_BEFORE_ARGS= -qo -a .include diff --git a/japanese/p5-PDFJ/distinfo b/japanese/p5-PDFJ/distinfo index b7ad291b9c90..2c57a849a356 100644 --- a/japanese/p5-PDFJ/distinfo +++ b/japanese/p5-PDFJ/distinfo @@ -1 +1 @@ -MD5 (PDFJ-0.6.zip) = 0baad2a76939144ff6404ab9d76c4c03 +MD5 (PDFJ-0.71.zip) = 4de974317e91297af70152bf3878efd6 diff --git a/japanese/p5-PDFJ/files/patch-Object.pm b/japanese/p5-PDFJ/files/patch-Object.pm deleted file mode 100644 index a9f0cdf347f9..000000000000 --- a/japanese/p5-PDFJ/files/patch-Object.pm +++ /dev/null @@ -1,10 +0,0 @@ ---- PDFJ/Object.pm.orig Thu Oct 24 16:32:34 2002 -+++ PDFJ/Object.pm Thu Oct 24 16:37:38 2002 -@@ -133,6 +133,7 @@ - - sub makeoutput { - my $self = shift; -+ $self->{outputtype} = "" if (not defined $self->{outputtype}); - if( $self->{outputtype} !~ /^(literal|hex|hexliteral)$/ ) { - $self->{outputtype} = - $self->{value} =~ /[\x80-\xff]/ ? 'hex' : 'literal'; diff --git a/japanese/p5-PDFJ/files/patch-PDFJ.pm b/japanese/p5-PDFJ/files/patch-PDFJ.pm index d8a827888201..f881034daa36 100644 --- a/japanese/p5-PDFJ/files/patch-PDFJ.pm +++ b/japanese/p5-PDFJ/files/patch-PDFJ.pm @@ -1,166 +1,67 @@ ---- PDFJ.pm.orig Fri Oct 18 14:18:10 2002 -+++ PDFJ.pm Thu Oct 24 16:31:42 2002 -@@ -813,7 +813,7 @@ - - sub ascii85chunk { - my($chunk) = @_; -- my $chunk = unpack("N", $chunk); -+ $chunk = unpack("N", $chunk); - my $resultchunk; - $resultchunk .= chr(int($chunk / (85 ** 4)) + 33); - $chunk = $chunk % (85 ** 4); -@@ -1394,9 +1394,9 @@ - croak "ascii font type mismatch" - if $hfontobj && !UNIVERSAL::isa($hfontobj, "PDFJ::AFont"); - my $name = $docobj->_fontname($basefont, $encoding); -- my $hname = $hfontobj ? $hfontobj->{name} : undef; -- return $docobj->_fontobj($name, $hname) -- if $name && $docobj->_fontobj($name, $hname); -+ my $hfontname = $hfontobj ? $hfontobj->{name} : undef; -+ return $docobj->_fontobj($name, $hfontname) -+ if $name && $docobj->_fontobj($name, $hfontname); - # Zenkaku font - my $code = $PDFJ::Default{Jcode}; - my($direction) = $encoding =~ /-(\w+)$/; -@@ -1460,9 +1460,9 @@ - croak "ascii font type mismatch" - if $hfontobj && !UNIVERSAL::isa($hfontobj, "PDFJ::AFont"); - my $name = $docobj->_fontname($ttffile, $encoding); -- my $hname = $hfontobj ? $hfontobj->{name} : undef; -- return $docobj->_fontobj($name, $hname) -- if $name && $docobj->_fontobj($name, $hname); -+ my $hfontname = $hfontobj ? $hfontobj->{name} : undef; -+ return $docobj->_fontobj($name, $hfontname) -+ if $name && $docobj->_fontobj($name, $hfontname); - # Zenkaku font - my $code = $PDFJ::Default{Jcode}; - my($direction) = $encoding =~ /-(\w+)$/; -@@ -1729,7 +1729,9 @@ - sub equal { - my($self, $other) = @_; - for my $key(qw(fontname fontsize render rise shapestyle)) { -- return 0 if $self->{$key} ne $other->{$key}; -+ return 0 if (($self->{$key} and not $other->{$key}) or -+ (not $self->{$key} and $other->{$key}) or -+ ($self->{$key} ne $other->{$key})); - } - return 1; - } -@@ -1739,8 +1741,8 @@ - croak "no fontsize specification" unless $self->{fontsize}; - my $fontname = $self->{fontname}; - my $fontsize = $self->{fontsize}; -- my $rise = $self->{rise} + 0; -- my $render = $self->{render} + 0; -+ my $rise = $self->{rise} || 0; -+ my $render = $self->{render} || 0; - my $shapepdf = $self->{shapestyle} ? $self->{shapestyle}->pdf : ""; - my $pdf = "q "; - $pdf .= "$shapepdf " if $shapepdf; -@@ -2336,7 +2338,7 @@ - my $chunk = $self->chunk($start + $j); - if( $chunk->{Splittable} ) { - #$chunk->{GlueFix} += $incsize / $chunk->{Style}{fontsize} / -- $splittables; -+ # $splittables; - $fixedglues[$j] += $incsize / $chunk->{Style}{fontsize} / - $splittables; - } -@@ -2388,11 +2390,11 @@ - my $docobj = $page->docobj; - my $chunksnum = $self->chunksnum; - my %usefontname; -- my($tj, $dotpdf, $shapepdf); -+ my($tj, $dotpdf, $shapepdf) = ("", "", ""); - my $lasttextspec = PDFJ::TextSpec->new; -- my($lastfontname, $lastfontsize, $postshift, $ulx, $uly, $bxx, $bxy, -- $slant, $va, $lastfrx, $lastfry, $withlinestyle, $withbox, -- $withboxstyle); -+ my($lastfontsize, $postshift, $va, $ulx, $uly, $bxx, $bxy, -+ $slant, $lastfrx, $lastfry, $withlinestyle, $withbox, -+ $withboxstyle) = (0, 0, 0); - for( my $j = 0; $j < $count && $start + $j < $chunksnum; $j++ ) { - my $chunk = $self->chunk($start + $j); - my $mode = $chunk->{Mode}; -@@ -2528,7 +2530,7 @@ - $align = 'tc'; - } - } -- my $altsize = $altsize * 1000 / $fontsize; -+ $altsize = $altsize * 1000 / $fontsize; - $altsize = -$altsize if $direction eq 'H'; - $tj .= "$altsize "; - $altobj->show($page, $flx + $asx, $fly + $asy, $align); -@@ -2782,7 +2784,7 @@ - sub _appendchunks { - my($chunks, $style, $mode, $class, $char, $preshift, $postshift, - $nottol, $noteol) = @_; -- my($splittable, $glue, $gluedec, $glueinc, $gluepref); -+ my($splittable, $glue, $gluedec, $glueinc, $gluepref) = (0, 0, 0, 0); - if( exists $style->{font} && exists $style->{font}{subset_unicodes} ) { - my $unicode = $PDFJ::Default{Jcode} eq 'SJIS' ? - PDFJ::Unicode::s2u($char) : PDFJ::Unicode::e2u($char); -@@ -2810,6 +2812,8 @@ - } - ($glue, $gluedec, $glueinc, $gluepref) = _calcglue($glue); - } -+ $preshift = 0 if (not defined $preshift); -+ $postshift = 0 if (not defined $postshift); - push @$chunks, [\%ChunkIndex, $style, $mode, $class, $splittable, - $glue, $gluedec, $glueinc, $gluepref, 1, $char, - $preshift, $postshift]; -@@ -2971,7 +2975,13 @@ - use vars qw(@ISA); - @ISA = qw(PDFJ::Style); - --sub PStyle { PDFJ::ParagraphStyle->new(@_) } -+sub PStyle { -+ my $self = PDFJ::ParagraphStyle->new(@_); -+ foreach (qw(labelsize beginindent endindent)) { -+ $self->{$_} = 0 if (not defined $self->{$_}); -+ } -+ $self; -+} - - #-------------------------------------------------------------------------- - package PDFJ::Paragraph; -@@ -3164,7 +3174,11 @@ - use vars qw(@ISA); - @ISA = qw(PDFJ::Style); - --sub BStyle { PDFJ::BlockStyle->new(@_) } -+sub BStyle { -+ my $self = PDFJ::BlockStyle->new(@_); -+ $self->{align} = "tl" if (not defined $self->{align}); -+ $self; -+} - - #-------------------------------------------------------------------------- - package PDFJ::Block; -@@ -3187,6 +3201,8 @@ - my $objects = (@objects == 1 && ref($objects[0]) eq 'ARRAY') ? - $objects[0] : \@objects; - my $self = bless { direction => $direction, objects => $objects, -+ xpreshift => 0, xpostshift => 0, -+ ypreshift => 0, ypostshift => 0, - style => $style }, $class; - $self->_calcsize; - $self->adjustwidth($style->{width}) if $style->{width}; -@@ -3278,7 +3294,7 @@ - - sub _calcsize { - my($self) = @_; -- my($width, $height); -+ my($width, $height) = (0, 0); - my $objnum = @{$self->{objects}}; - my $adjust = $self->{style}{adjust}; - my $align = $self->{style}{align}; -@@ -3450,7 +3466,7 @@ - if( $self->{direction} eq 'V' ) { - for( my $j = 0; $j < $objnum; $j++ ) { - my $obj = $self->{objects}->[$j]; -- my $indent = $self->{indents}->[$j]; -+ my $indent = $self->{indents}->[$j] || 0; - if( $j > 0 ) { - my $preobj = $self->{objects}->[$j-1]; - $y -= $preobj->postskip +--- PDFJ.pm.orig Mon Nov 3 17:20:56 2003 ++++ PDFJ.pm Mon Nov 3 17:55:17 2003 +@@ -1801,9 +1801,9 @@ + } + my $self; + if( @args == 1 ) { +- if( !ref($args[0]) ) { ++ if( $args[0] and !ref($args[0]) ) { + $self = PDFJ::Util::strstyle2hashref($args[0]); +- } elsif( ref($args[0]) eq 'HASH' || ref($args[0]) eq $class ) { ++ } elsif( $args[0] and (ref($args[0]) eq 'HASH' || ref($args[0]) eq $class) ) { + %$self = %{$args[0]}; + } else { + croak "illegal $class->new() argument"; +@@ -1811,7 +1811,7 @@ + } else { + %$self = @args; + } +- if( %$self == 1 && $self->{style} ) { ++ if( keys %$self == 1 && $self->{style} ) { + $self = $class->new($self->{style}); + } + for my $key(keys %$self) { +@@ -1843,7 +1843,7 @@ + } else { + %args = @args; + } +- if( %args == 1 && $args{style} ) { ++ if( keys %args == 1 && $args{style} ) { + $clone = $self->clone($args{style}); + } else { + $clone = $self->new(%$self); +@@ -3234,7 +3234,7 @@ + my($self, $str) = @_; + my $style = $self->style; + my $result = []; +- my @c = split('', $str); ++ my @c = split('', $str || ""); + for( my $j = 0; $j <= $#c; $j++ ) { + my $c = $c[$j]; + if( $c ge "\x81" && $c le "\x9f" || $c ge "\xe0" && $c le "\xfc" ) { +@@ -4166,7 +4166,6 @@ + sub new1 { + my($class, $value) + = PDFJ::Util::methodargs([qw(value)], @_); +- my $class = shift; + my $self; + if( ref($value) eq 'ARRAY' ) { + $self = bless { type => 'rgb', value => $value }, $class; +@@ -4487,7 +4486,7 @@ + my($self, $x, $y, $w, $h, $style) + = PDFJ::Util::methodargs([qw(x y w h style)], @_); + $style = PDFJ::ShapeStyle->new($style) +- if !ref($style) || ref($style) eq 'HASH'; ++ if ($style and (!ref($style) || ref($style) eq 'HASH')); + my @stylepdf; + @stylepdf = $style->pdf if $style; + my($x1, $y1, $x2, $y2) = ($x, $y, $x + $w, $y + $h); +@@ -4528,7 +4527,7 @@ + = PDFJ::Util::methodargs([qw(x y w h spec style)], @_); + $spec = "s" unless $spec; + $style = PDFJ::ShapeStyle->new($style) +- if !ref($style) || ref($style) eq 'HASH'; ++ if ($style and (!ref($style) || ref($style) eq 'HASH')); + my @stylepdf; + @stylepdf = $style->pdf if $style; + my($r); diff --git a/japanese/p5-PDFJ/pkg-plist b/japanese/p5-PDFJ/pkg-plist index e7fa4feaddd3..06772122e642 100644 --- a/japanese/p5-PDFJ/pkg-plist +++ b/japanese/p5-PDFJ/pkg-plist @@ -5,6 +5,8 @@ %%SITE_PERL%%/PDFJ/TTF.pm %%SITE_PERL%%/PDFJ/U2C.pm %%SITE_PERL%%/PDFJ/Unicode.pm +%%SITE_PERL%%/XPDFJ.pm %%SITE_PERL%%/%%PERL_ARCH%%/auto/PDFJ/.packlist @dirrm %%SITE_PERL%%/PDFJ @dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/PDFJ +@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto 2>/dev/null || true -- cgit v1.2.3