-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Package: ghostscript Version: 8.71~dfsg2-1 Severity: wishlist Tags: l10n patch
Hi, Thank you for keeping ghostscript maintainance. I saw newest changelog had: * Strip CMap files (shipped separately, registered with DeFoMa). But "dropping defoma" is one of goals on Squeeze, at least of pkg-fonts-devel team. Actually because most fonts have already dropped defoma, CJK support of ghostscript is dead at this time. I tried to solve this situation since some monthes ago, http://wiki.debian.org/gs-undefoma and I believe the patch is completed now. This patch is passed a test by some Japanese users. Could you see the attached patch? It adds: update-gsfontmap which makes cidfmap and Fontmap. /var/lib/ghostscript/CMap and /var/lib/ghostscript/fonts directory. It removes: defoma dependency. old defoma files. This migration needs a modification of gsfonts, cmap-adobe-*, and gs-cjk-resource also. I'll send a patch to gsfonts later. I can upload cmap-adobe-* and gs-cjk-resource by myself as soon as you apply my patch. Thanks, - -- Kenshi Muto [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.9 <http://mailcrypt.sourceforge.net/> iQIcBAEBCgAGBQJL8pN4AAoJEB0hyD3EUuD8QCEP/3J2QMxZihblgSvSknjjgOAw mzlXB1jYBYz9vNUkKIrX3CbxTm/yUBRf6bJk9Ov8pK/ptKUXcOZ/dS6Qi6rlPEHw 157cBjaUaEu18YA0SiFHGLPy6417JuqToOAWj+xlAjq0B0caIbmHVx/9e5cO7vi1 2put6F00JQzlhnShQYw3Dph0yadLMe7ddc72TYbRb9049oPOypMJMy+25Zy0JFsZ cQxYRbpYVms1A8RvcRLJJJyLSgNplg4clnyhvono+97UVc1KoMjwt3GXa8Nt0EWr 3/oYVHheHUjKqvfOUFHLa8H9Iy70YHts4XjybYC1zQBS0GGqFUsw9Lio70kU5Vxw xV/ggj6JP1ndrueTUjQ9zbN2yu9M94B+zCqeHNp1ntdPM9CdxYycy825idecwPM8 r19kKkl+kgvE95YzmxgjQUWFBtacciTXfm+nTUhf42iv8wXsPv7kfFa8qzQ+qkaA qYnIQAJ7b4OD7A7hYeS5ItftRTWKdM/0yeSKekvh9caHdON2XaOhAXwIOT/HtLDl j0MCSWOcJYwpwPgm6C+kWDGY3aBY8cKJSa1dJQ8AR5yDtDhqMcF3PD1DKJ7CSEDj kghdJOnOsZ2HhH5No78b/SONu0e8LpCCdRMFdcGnQW8ypdKwVTYEBXAlzldm8VLO RdtJritNKP9/agj/I/IZ =lw3B -----END PGP SIGNATURE-----
diff -Nru ghostscript-8.71~dfsg2/debian/changelog ghostscript-8.71~dfsg2/debian/changelog --- ghostscript-8.71~dfsg2/debian/changelog 2010-05-18 02:04:31.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/changelog 2010-05-18 21:12:05.000000000 +0900 @@ -1,3 +1,11 @@ +ghostscript (8.71~dfsg2-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Drop defoma. + * Add update-gsfontmap to provide cidfmap and Fontmap. + + -- Kenshi Muto <[email protected]> Tue, 18 May 2010 21:11:45 +0900 + ghostscript (8.71~dfsg2-1) unstable; urgency=low * Use system jbig2dec: diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.dirs ghostscript-8.71~dfsg2/debian/ghostscript.dirs --- ghostscript-8.71~dfsg2/debian/ghostscript.dirs 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.dirs 2010-05-18 21:07:43.000000000 +0900 @@ -1,3 +1,4 @@ -etc/defoma/config -var/lib/defoma/gs.d/dirs/fonts -var/lib/defoma/gs.d/dirs/CMap +etc/ghostscript/cidfmap.d +etc/ghostscript/fontmap.d +var/lib/ghostscript/CMap +var/lib/ghostscript/fonts diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.install.in ghostscript-8.71~dfsg2/debian/ghostscript.install.in --- ghostscript-8.71~dfsg2/debian/ghostscript.install.in 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.install.in 2010-05-18 21:07:09.000000000 +0900 @@ -1,5 +1,5 @@ usr/bin/ -usr/share/defoma/scripts/ +usr/sbin/ # install subdir explicitly, to fail if wrong (same var used for symlink too) usr/share/ghostscript/__ABI__/ usr/share/man/ diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.links.in ghostscript-8.71~dfsg2/debian/ghostscript.links.in --- ghostscript-8.71~dfsg2/debian/ghostscript.links.in 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.links.in 2010-05-18 21:06:57.000000000 +0900 @@ -1,4 +1,4 @@ -var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/__ABI__/Resource/CMap +var/lib/ghostscript/CMap usr/share/ghostscript/__ABI__/Resource/CMap usr/bin/gs usr/bin/ghostscript usr/bin/ps2ascii usr/bin/ps2txt usr/share/man/de/man1/ps2ps.1.gz usr/share/man/de/man1/eps2eps.1.gz diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.postinst ghostscript-8.71~dfsg2/debian/ghostscript.postinst --- ghostscript-8.71~dfsg2/debian/ghostscript.postinst 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.postinst 2010-05-18 21:11:39.000000000 +0900 @@ -4,12 +4,7 @@ case "$1" in configure) - # Make sure the substitution file for Ghostscript exists - if ! defoma-subst check-rule ghostscript; then - defoma-subst new-rule ghostscript - fi - - defoma-app -t update gs + update-gsfontmap ;; abort-upgrade|abort-remove|abort-deconfigure) ;; diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.postrm ghostscript-8.71~dfsg2/debian/ghostscript.postrm --- ghostscript-8.71~dfsg2/debian/ghostscript.postrm 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.postrm 1970-01-01 09:00:00.000000000 +0900 @@ -1,24 +0,0 @@ -#! /bin/sh - -set -e - -case "$1" in - remove) - # Remove defoma directory - rm -rf /var/lib/defoma/gs.d - ;; - purge) - # Remove defoma-related files - rm -f /etc/defoma/ghostscript.subst-rule - rm -f /etc/defoma/ghostscript.subst-rule~ - ;; - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 -esac - -#DEBHELPER# - -exit 0 diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.preinst ghostscript-8.71~dfsg2/debian/ghostscript.preinst --- ghostscript-8.71~dfsg2/debian/ghostscript.preinst 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.preinst 2010-05-18 21:28:08.000000000 +0900 @@ -16,6 +16,14 @@ if dpkg --compare-versions "$2" lt-nl "8.64~dfsg-1"; then update-alternatives --remove-all ps2pdf || true fi + + # Remove obsolete defoma files + if dpkg --compare-versions "$2" lt-nl "8.71~dfsg2-1"; then + rm -rf /var/lib/defoma/gs.d + rm -f /etc/defoma/ghostscript.subst-rule + rm -f /etc/defoma/ghostscript.subst-rule~ + rm -f /var/lib/defoma/ghostscript.subst-cache + fi ;; abort-upgrade) ;; diff -Nru ghostscript-8.71~dfsg2/debian/ghostscript.prerm ghostscript-8.71~dfsg2/debian/ghostscript.prerm --- ghostscript-8.71~dfsg2/debian/ghostscript.prerm 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/ghostscript.prerm 2010-05-18 21:15:25.000000000 +0900 @@ -4,14 +4,10 @@ case "$1" in remove) - if which defoma-app >/dev/null 2>&1; then - defoma-app -t purge gs - fi + rm -f /var/lib/ghostscript/fonts/cidfmap \ + /var/lib/ghostscript/fonts/Fontmap ;; upgrade) - if which defoma-app >/dev/null 2>&1; then - defoma-app -t clean gs - fi ;; deconfigure) ;; diff -Nru ghostscript-8.71~dfsg2/debian/gs.defoma ghostscript-8.71~dfsg2/debian/gs.defoma --- ghostscript-8.71~dfsg2/debian/gs.defoma 2010-02-14 20:02:47.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/gs.defoma 1970-01-01 09:00:00.000000000 +0900 @@ -1,930 +0,0 @@ -# -# gs.defoma: Defoma support for Ghostscripts -# - -...@accept_categories = qw(type1 type3 gsfontderivative truetype cid - cmap psprint); - -package gs; -use strict; -use POSIX; - -use vars qw($DEFOMA_TEST_DIR $ROOTDIR); - -use Debian::Defoma::Common; -use Debian::Defoma::Font; -use Debian::Defoma::Id; -use Debian::Defoma::Subst; -import Debian::Defoma::Font; -import Debian::Defoma::Id; -import Debian::Defoma::Subst; -import Debian::Defoma::Common; - -my $Id; -my $IdCmap; -my $Sb1; -my $Sb2; - -my $PkgDir = "$ROOTDIR/gs.d"; -my $CidDir = "$PkgDir/dirs/CIDFont"; -my $CMapDir = "$PkgDir/dirs/CMap"; -my $TTCidDir = "$PkgDir/dirs/TTCIDFont"; -my $FontDir = "$PkgDir/dirs/fonts"; -my $FontMap = "$FontDir/Fontmap"; # F -my $CIDFontMap = "$FontDir/CIDFnmap"; # FF -my $Subst4psprint = 0; -# For Ghostscript 8 or later -my $FAPIfmap = "$FontDir/FAPIfontmap"; # FFF -my $Cidfmap = "$FontDir/cidfmap"; # FFFF - -sub init { - unless ($Id) { - $Id = defoma_id_open_cache(); - } - unless ($IdCmap) { - $IdCmap = defoma_id_open_cache('cmap'); - } - unless ($Sb1) { - $Sb1 = defoma_subst_open(rulename => 'psprint', threshold => 50, - idobject => $Id, private => 1); - } - unless ($Sb2) { - $Sb2 = defoma_subst_open(rulename => 'ghostscript', threshold => 30, - idobject => $Id); - } - - return 0; -} - -sub term { - my @list; - my $i; - - if ($Id) { - if (open(F, '>' . $FontMap) && open(FF, '>' . $CIDFontMap) && - open(FFF, '>' . $FAPIfmap) && open(FFFF, '>' . $Cidfmap)) { - @list = defoma_id_get_font($Id, 'installed'); - - foreach $i (@list) { - next if ($Id->{2}->[$i] ne 'SrI'); - my $c = $Id->{4}->[$i]; - my $f; - my @h; - my $cmap; - my @cmaplist; - my $j; - my @ch; - my %hh; - - if ($c =~ /^(type1|type3|gsfontderivative)$/) { - $f = $Id->{1}->[$i]; - $f =~ s/^.*\///; - # - # Spit out $FontDir/Fontmap - # - print F '/', $Id->{0}->[$i], ' (', $f, ") ;\n"; - } elsif ($c =~ /^truetype$/) { - $f = $Id->{1}->[$i]; - # - # Spit out $FontDir/FAPIfontmap - # - # FIXME: need to support the sub font id for the collection. - print FFF '/', $Id->{0}->[$i], ' << /Path (', $f, ') /FontType 1 /FAPI /FreeType /SubfontId ', '0' , " >> ;\n" - } elsif ($c =~ /^(truetype-cjk|cid)$/) { - $f = $Id->{1}->[$i]; - @h = split(/ +/, $Id->{7}->[$i]); - # - # Spit out $FontDir/CIDFnmap - # - print FF '/', $Id->{0}->[$i], ' (', $f, ') '; - if ($c eq 'truetype-cjk') { - print FF '/', $h[0], '-', $h[1], '-', $h[2]; - } - print FF " ;\n"; - # For Ghostscript 8 or later - if ($c eq 'truetype-cjk') { - my @hints = defoma_id_get_hints( $Id, $i ); - my $cidsupplement; - while (@hints) { - my $var = shift @hints; - if ($var eq "--CIDSupplement") { - $cidsupplement = shift @hints; - last; - } - } - unless (defined $cidsupplement) { - print STDERR "No CIDSupplement specified for $Id->{0}->[$i], defaulting to 0.\n"; - $cidsupplement = 0; - } - # - # Spit out $FontDir/cidfmap - # - # FIXME: need to support the sub font id for the collection. - print FFFF '/', $Id->{0}->[$i], ' << /FileType /TrueType /Path (', $f, ') /SubfontID ', '0', ' /CSI [(', $h[6], ') ', $cidsupplement, "] >> ;\n"; - } - } - } - - @list = defoma_id_get_font($Id, 'installed'); - - foreach $i (@list) { - next if ($Id->{2}->[$i] !~ /^.[aS]/); - - my $c = $Id->{4}->[$i]; - # - # Spit out aliases - # - if ($c =~ /^(truetype|type1|type3|gsfontderivative)$/) { - print F '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n"; - print FFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n"; - } elsif ($c =~ /^(truetype-cjk|cid)$/) { - print FF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n"; - print FFFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n"; - } - - } - - close F; - close FF; - close FFF; - close FFFF; - unlink($FontMap) unless(-s $FontMap); - unlink($CIDFontMap) unless(-s $CIDFontMap); - unlink($FAPIfmap) unless(-s $FAPIfmap); - unlink($Cidfmap) unless(-s $Cidfmap); - } - - defoma_id_close_cache($Id); - $Id = 0; - } - if ($IdCmap) { - defoma_id_close_cache($IdCmap); - $IdCmap = 0; - } - if ($Sb1) { - defoma_subst_close($Sb1); - $Sb1 = 0; - } - if ($Sb2) { - defoma_subst_close($Sb2); - $Sb2 = 0; - } - - return 0; -} - -sub create_symlink { - my $font = shift; - my $dir = shift || $FontDir; - - if ($font =~ /^(.*)\/(.+)$/) { - my $fontpath = $1; - my $fontfile = $2; - my $newfile = $dir . '/' . $fontfile; - - return 1 if (-e $newfile); - - symlink($font, $newfile) || return 1; - } else { - return 1; - } - - return 0; -} - -sub remove_symlink { - my $font = shift; - my $dir = shift || $FontDir; - - if ($font =~ /^(.*)\/(.+)$/) { - my $fontpath = $1; - my $fontfile = $2; - my $newfile = $dir . '/' . $fontfile; - - return 1 unless (-l $newfile); - - unlink($newfile); - } else { - return 1; - } - - return 0; -} - -sub register_ps { - my $id = shift; - - defoma_font_register('postscript', '<gs>/' . $id, @_); -} - -sub unregister_ps { - my $id = shift; - - if (defoma_font_if_register('postscript', '<gs>/' . $id)) { - defoma_font_unregister('postscript', '<gs>/' . $id); - } -} - -sub t1_register { - my $type = shift; - my $font = shift; - my $h = parse_hints_start(@_); - - my $fontname = $h->{FontName}; - return 1 unless ($fontname); - $fontname =~ s/ .*//; - - my $priority = $h->{Priority} || 0; - - my %add; - $add{hints} = join(' ', @_); - - if ($type eq 'gsfontderivative') { - my $ofont = $h->{'GSF-OriginFont'}; - my $oid = $h->{'GSF-OriginID'}; - - if ($ofont && $oid) { - $add{depend} = $ofont.' '.$oid; - } else { - return 2; - } - } - - return 3 if (create_symlink($font)); - - defoma_id_register($Id, type => 'real', font => $font, id => $fontname, - priority => $priority, %add); - - my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); - my $i; - - foreach $i (@alias) { - defoma_id_register($Id, type => 'alias', font => $font, id => $i, - priority => $priority, origin => $fontname); - } - - defoma_subst_register($Sb1, $font, $fontname); - defoma_subst_register($Sb2, $font, $fontname); - - return 0; -} - -sub t1_unregister { - my $font = shift; - - defoma_subst_unregister($Sb1, $font); - defoma_subst_unregister($Sb2, $font); - defoma_id_unregister($Id, type => 'alias', font => $font); - defoma_id_unregister($Id, type => 'real', font => $font); - - remove_symlink($font); - - return 0; -} - -sub t1_install { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - my @add = (); - - if ($type eq 'real') { - return 0 if (grep($_ eq '--Alias', @_)); - - $add[0] = '--RealName'; - } - - register_ps($id, @_, @add); - - return 0; -} - -sub t1_remove { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - - unregister_ps($id); - - return 0; -} - -sub type1 { - my $com = shift; - - if ($com eq 'register') { - return t1_register('type1', @_); - } elsif ($com eq 'unregister') { - return t1_unregister(@_); - } elsif ($com =~ /^do-install-(.*)$/) { - return t1_install($1, @_); - } elsif ($com =~ /^do-remove-(.*)$/) { - return t1_remove($1, @_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -sub type3 { - return type1(@_); -} - -sub gsfontderivative { - my $com = shift; - - if ($com eq 'register') { - return t1_register('gsfontderivative', @_); - } else { - return type1($com, @_); - } -} - -sub tt_register_cjk { - my %addstr = ('Japanese' => '-Ja', - 'Korean' => '-Ko', - 'Chinese-China' => '-GB', - 'Chinese-Taiwan' => '-CNS'); - my %ordering = ('Japanese' => 'Japan1', - 'Korean' => 'Korea1', - 'Chinese-China' => 'GB1', - 'Chinese-Taiwan' => 'CNS1'); - my %coding = ('Unicode' => 'Unicode', - 'BIG5' => 'Big5', - 'ShiftJIS' => 'ShiftJIS', - 'WanSung' => 'WanSung', - 'Johab' => 'Johab'); - - my $cnt = shift; - my $loc = shift; - my $font = shift; - my $fontname = shift; - my $alias = shift; - my $charset = shift; - my $encoding = shift; - my $priority = shift; - - return $cnt unless (exists($addstr{$loc}) && exists($ordering{$loc}) && - exists($coding{$encoding})); - my $ord = $ordering{$loc}; - my $enc = $coding{$encoding}; - - my $add = ''; - $add = $addstr{$loc} if ($cnt > 0); - - my @hints = ('Adobe', $ord, $enc, - '--CIDRegistry', 'Adobe', '--CIDOrdering', $ord); - - defoma_id_register($Id, type => 'real', font => $font, - id => $fontname . $add, priority => $priority, - category => 'truetype-cjk', - hints => join(' ', @hints, @_)); - - foreach my $i (@{$alias}) { - defoma_id_register($Id, type => 'alias', font => $font, - id => $i . $add, priority => $priority, - category => 'truetype-cjk', - origin => $fontname . $add); - } - - defoma_subst_register($Sb1, $font, $fontname . $add); - defoma_subst_register($Sb2, $font, $fontname . $add); - - $cnt++; - return $cnt unless ($charset =~ /JISX0212/ && $loc eq 'Japanese' && - $encoding eq 'Unicode'); - - $add = '-JaH'; - @hints = ('Adobe', 'Japan2', 'Unicode', - '--CIDRegistry', 'Adobe', '--CIDOrdering', 'Japan2'); - - defoma_id_register($Id, type => 'real', font => $font, - id => $fontname . $add, priority => $priority, - category => 'truetype-cjk', - hints => join(' ', @hints, @_)); - - foreach my $i (@{$alias}) { - defoma_id_register($Id, type => 'alias', font => $font, - id => $i . $add, priority => $priority, - category => 'truetype-cjk', - origin => $fontname . $add); - } - - defoma_subst_register($Sb1, $font, $fontname . $add); - defoma_subst_register($Sb2, $font, $fontname . $add); - - $cnt++; - return $cnt; -} - -sub tt_register { - my $font = shift; - my $h = parse_hints_start(@_); - my $i; - - my $fontname = $h->{FontName}; - my $location = $h->{Location}; - my $encoding = $h->{Encoding}; - my $priority = $h->{Priority} || 0; - my $charset = $h->{Charset}; - - return 1 unless ($fontname && $location && $encoding); - $fontname =~ s/ .*//; - my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); - - return 2 if (create_symlink($font)); - - parse_hints_cut($h, 'Encoding', 'Location', 'FontName'); - my @hints; - - if ($location !~ /Japanese|Korean|Chinese/) { - @hints = parse_hints_build($h); - - defoma_id_register($Id, type => 'real', font => $font, id => $fontname, - priority => $priority, hints => join(' ', @hints)); - - foreach $i (@alias) { - defoma_id_register($Id, type => 'alias', font => $font, id => $i, - priority => $priority, origin => $fontname); - } - - defoma_subst_register($Sb1, $font, $fontname); - defoma_subst_register($Sb2, $font, $fontname); - } else { - parse_hints_cut($h, 'Charset'); - @hints = parse_hints_build($h); - - my $loc; - my @locs = split(/ /, $location); - my $cnt = 0; - - foreach $loc (@locs) { - $cnt = tt_register_cjk($cnt, $loc, $font, $fontname, \...@alias, - $charset, $encoding, $priority, @hints); - } - } - - return 0; -} - -sub tt_unregister { - my $font = shift; - - defoma_subst_unregister($Sb1, $font); - defoma_subst_unregister($Sb2, $font); - defoma_id_unregister($Id, type => 'alias', font => $font); - defoma_id_unregister($Id, type => 'real', font => $font); - - remove_symlink($font); - - return 0; -} - -sub tt_install { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - - my @add = (); - - $add[0] = '--RealName' if ($type eq 'real'); - - register_ps($id, @_, @add); - - return 0; -} - -sub tt_remove { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - - unregister_ps($id); - - return 0; -} - -sub truetype { - my $com = shift; - - if ($com eq 'register') { - return tt_register(@_); - } elsif ($com eq 'unregister') { - return tt_unregister(@_); - } elsif ($com =~ /^do-install-(.*)$/) { - return tt_install($1, @_); - } elsif ($com =~ /^do-remove-(.*)$/) { - return tt_remove($1, @_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -sub truetype_cjk { - my $com = shift; - - if ($com =~ /^do-install-(.*)$/) { - return cid_install($1, @_); - } elsif ($com =~ /^do-remove-(.*)$/) { - return cid_remove($1, @_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -sub cid_register { - my $type = shift; - my $font = shift; - my $h = parse_hints_start(@_); - - my $fontname = $h->{FontName}; - my $registry = $h->{CIDRegistry}; - my $ordering = $h->{CIDOrdering}; - my $priority = $h->{Priority} || 0; - - return 1 unless($fontname && $registry && $ordering); - $fontname =~ s/ .*//; - $registry =~ s/ .*//; - $ordering =~ s/ .*//; - my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); - - return 2 if (create_symlink($font)); - - parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding'); - my @hints = parse_hints_build($h); - @hints = ($registry, $ordering, '.', @hints); - - defoma_id_register($Id, type => 'real', font => $font, - id => $fontname, priority => $priority, - category => $type, hints => join(' ', @hints)); - - my $i; - foreach $i (@alias) { - defoma_id_register($Id, type => 'alias', font => $font, id => $i, - priority => $priority, origin => $fontname, - category => $type); - } - - defoma_subst_register($Sb1, $font, $fontname); - defoma_subst_register($Sb2, $font, $fontname); - - return 0; -} - -sub cid_unregister { - my $font = shift; - - defoma_subst_unregister($Sb1, $font); - defoma_subst_unregister($Sb2, $font); - defoma_id_unregister($Id, type => 'alias', font => $font); - defoma_id_unregister($Id, type => 'real', font => $font); - - remove_symlink($font); - - return 0; -} - -sub cid_install_all { - my $type = shift; - my $id = shift; - my $registry = shift; - my $ordering = shift; - - my @cmaps = defoma_id_get_font($IdCmap, 'installed'); - foreach my $c (@cmaps) { - my @chs = split(/ +/, $IdCmap->{7}->[$c]); - - next if ($chs[0] ne $registry); - next if ($chs[1] ne $ordering && $chs[1] ne 'Identity'); - - shift(@chs); - shift(@chs); - - my $psname = $id . '-' . $IdCmap->{0}->[$c]; - - my @add = (); - $add[0] = '--RealName' if ($type eq 'real'); - - register_ps($psname, @_, @add, @chs); - } - - return 0; -} - -sub cid_remove_all { - my $type = shift; - my $id = shift; - my $registry = shift; - my $ordering = shift; - - my @cmaps = defoma_id_get_font($IdCmap, 'installed'); - foreach my $c (@cmaps) { - my @chs = split(/ +/, $IdCmap->{7}->[$c]); - - next if ($chs[0] ne $registry); - next if ($chs[1] ne $ordering && $chs[1] ne 'Identity'); - - my $psname = $id . '-' . $IdCmap->{0}->[$c]; - - unregister_ps($psname); - } - - return 0; -} - -sub cid_install { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - my $registry = shift; - my $ordering = shift; - my $encoding = shift; - - cid_install_all($type, $id, $registry, $ordering, @_); - - return 0; -} - -sub cid_remove { - my $type = shift; - my $font = shift; - my $id = shift; - my $depfont = shift; - my $depid = shift; - my $registry = shift; - my $ordering = shift; - my $encoding = shift; - - cid_remove_all($type, $id, $registry, $ordering); - - return 0; -} - -sub cid { - my $com = shift; - - if ($com eq 'register') { - return cid_register('cid', @_); - } elsif ($com eq 'unregister') { - return cid_unregister(@_); - } elsif ($com =~ /^do-install-(.*)$/) { - return cid_install($1, @_); - } elsif ($com =~ /^do-remove-(.*)$/) { - return cid_remove($1, @_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -sub cmap_register { - my $font = shift; - - if ($font =~ /\/gs-cjk-resource\//) { - return 2 if (create_symlink($font, $CMapDir)); - return 0; - } - - my $h = parse_hints_start(@_); - - my $cmap = $h->{CMapName}; - my $reg = $h->{CIDRegistry}; - my $ord = $h->{CIDOrdering}; - - return 1 unless ($cmap && $reg && $ord); - $reg =~ s/ .*//; - $ord =~ s/ .*//; - $cmap =~ s/ .*//; - - my @hints = ($reg, $ord, @_); - - defoma_id_register($IdCmap, type => 'real', font => $font, id => $cmap, - priority => 0, hints => join(' ', @hints)); - - return 0; -} - -sub cmap_unregister { - my $font = shift; - - if ($font =~ /\/gs-cjk-resource\//) { - remove_symlink($font, $CMapDir); - return 0; - } - - defoma_id_unregister($IdCmap, type => 'real', font => $font); - - return 0; -} - -sub cmap_install { - my $font = shift; - my $cmap = shift; - my $df = shift; - my $di = shift; - my $reg = shift; - my $ord = shift; - my %hash; - my @nonreal = (); - - return 1 if (create_symlink($font, $CMapDir)); - - my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'), - defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk')); - - foreach my $i (@list) { - my $type = $Id->{2}->[$i]; - my $id = $Id->{0}->[$i]; - - if ($type ne 'SrI') { - push(@nonreal, $i); - next; - } - - my @hints = split(/ +/, $Id->{7}->[$i]); - - next if ($hints[0] ne $reg); - next if ($hints[1] ne $ord && $ord ne 'Identity'); - - $hash{$id} = $i; - - shift(@hints); - shift(@hints); - shift(@hints); - - my $psname = $id . '-' . $cmap; - - register_ps($psname, @hints, '--RealName', @_); - } - - foreach my $i (@nonreal) { - my $depid = $Id->{5}->[$i]; - next unless (exists($hash{$depid})); - - my @hints = split(/ +/, $Id->{7}->[$hash{$depid}]); - - next if ($hints[0] ne $reg); - next if ($hints[1] ne $ord && $ord ne 'Identity'); - - shift(@hints); - shift(@hints); - shift(@hints); - - my $psname = $Id->{0}->[$i] . '-' . $cmap; - - register_ps($psname, @hints, @_); - } - - return 0; -} - -sub cmap_remove { - my $font = shift; - my $cmap = shift; - my $df = shift; - my $di = shift; - my $reg = shift; - my $ord = shift; - my %hash; - - remove_symlink($font, $CMapDir); - - my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'), - defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk')); - - foreach my $i (@list) { - my @hints = split(/ +/, $Id->{7}->[$i]); - - if (@hints > 0) { - next if ($hints[0] ne $reg); - next if ($hints[1] ne $ord && $ord ne 'Identity'); - } - - my $psname = $Id->{0}->[$i] . '-' . $cmap; - - unregister_ps($psname); - } - - return 0; -} - -sub cmap { - my $com = shift; - - if ($com eq 'register') { - return cmap_register(@_); - } elsif ($com eq 'unregister') { - return cmap_unregister(@_); - } elsif ($com eq 'do-install-real') { - return cmap_install(@_); - } elsif ($com eq 'do-remove-real') { - return cmap_remove(@_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -sub psprint_register { - my $font = shift; - return 0 unless ($Subst4psprint); - return 1 if ($font !~ /(.+)\/(.+)/); - - return 0 if ($1 eq '<gs>'); - my $fontname = $2; - - return 2 if ($Sb1->grep_rule('', $fontname)); - - my @hints; - my $h = parse_hints_start(@_); - my $cset = $h->{PSCharset}; - my $enc = $h->{PSEncoding}; - - if ($cset && $enc && $cset =~ /^Adobe-([^-]+).*$/) { - my $ord = $1; - $fontname =~ s/-$enc$//; - - parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding', - 'Direction'); - @hints = parse_hints_build($h); - push(@hints, '--CIDRegistry,*', 'Adobe', '--CIDOrdering,*', $ord); - } else { - @hints = @_; - } - - for my $i (@hints) { - $i = '--Charset,*' if ($i eq '--Charset'); - $i = '--Encoding,*' if ($i eq '--Encoding'); - $i = '--Direction,*' if ($i eq '--Direction'); - $i = '--Shape,2' if ($i eq '--Shape'); - } - - defoma_subst_add_rule($Sb1, $fontname, @hints); - - return 0; -} - -sub psprint_unregister { - my $font = shift; - return 0 if ($font !~ /(.+)\/(.+)/); - - return 0 if ($1 eq '<gs>'); - my $fontname = $2; - - my $h = parse_hints_start(@_); - my $cset = $h->{PSCharset}; - my $enc = $h->{PSEncoding}; - - if ($cset && $enc && $cset =~ /^Adobe-.*$/) { - $fontname =~ s/-$enc$//; - } - - defoma_subst_remove_rule($Sb1, $fontname); - - return 0; -} - -sub psprint { - my $com = shift; - - if ($com eq 'register') { - return psprint_register(@_); - } elsif ($com eq 'unregister') { - return psprint_unregister(@_); - } elsif ($com eq 'init') { - return init(); - } elsif ($com eq 'term') { - return term(); - } - - return 0; -} - -1; diff -Nru ghostscript-8.71~dfsg2/debian/rules ghostscript-8.71~dfsg2/debian/rules --- ghostscript-8.71~dfsg2/debian/rules 2010-05-08 00:05:02.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/rules 2010-05-18 21:42:28.000000000 +0900 @@ -125,7 +125,7 @@ --with-x --disable-gtk \ --enable-dynamic --with-omni --enable-cups --disable-compile-inits \ --with-drivers=ALL \ - --with-fontpath=/var/lib/defoma/gs.d/dirs/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts + --with-fontpath=/var/lib/ghostscript/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts # cairo support still experimental and makes core gs depend on X11 libs. DEB_CONFIGURE_EXTRA_FLAGS += --disable-cairo @@ -171,10 +171,6 @@ rm -rf sobin soobj gs.a install/ghostscript:: - mkdir -p $(DEB_DESTDIR)/usr/share/defoma/scripts/ - install -m 644 debian/gs.defoma \ - $(DEB_DESTDIR)/usr/share/defoma/scripts/ - # Remove some of the scripts rm $(DEB_DESTDIR)/usr/bin/unix-lpr.sh $(DEB_DESTDIR)/usr/bin/lprsetup.sh $(DEB_DESTDIR)/usr/bin/pv.sh $(DEB_DESTDIR)/usr/bin/fixmswrd.pl @@ -183,6 +179,8 @@ # Rename /usr/bin/gsc, to not conflict with gambc mv $(DEB_DESTDIR)/usr/bin/gsc $(DEB_DESTDIR)/usr/bin/gs + mkdir -p $(DEB_DESTDIR)/usr/sbin/ + install -m 755 debian/update-gsfontmap $(DEB_DESTDIR)/usr/sbin # Strip CMap files (shipped separately, registered with DeFoMa) rm -rf $(DEB_DESTDIR)/usr/share/ghostscript/$(abi)/Resource/CMap @@ -224,11 +222,10 @@ CDBS_BUILD_DEPENDS += , pkg-config # Needed (always, often, sometimes) at runtime -CDBS_DEPENDS_ghostscript += , gsfonts (>= 6.0-1), defoma, debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= $(DEB_VERSION)) +CDBS_DEPENDS_ghostscript += , gsfonts (>= 6.0-1), debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= $(DEB_VERSION)) CDBS_DEPENDS_ghostscript-cups += , ghostscript (>= 8.64~dfsg-8) CDBS_DEPENDS_ghostscript-x += , ghostscript (= $(DEB_VERSION)) CDBS_DEPENDS_libgs-dev += , libgs8 (= $(DEB_VERSION)) -CDBS_RECOMMENDS_ghostscript += , psfontmgr CDBS_RECOMMENDS_ghostscript-cups += , cups, cups-client CDBS_SUGGESTS_ghostscript += , ghostscript-x, ghostscript-cups, hpijs CDBS_SUGGESTS_ghostscript-doc += , ghostscript diff -Nru ghostscript-8.71~dfsg2/debian/update-gsfontmap ghostscript-8.71~dfsg2/debian/update-gsfontmap --- ghostscript-8.71~dfsg2/debian/update-gsfontmap 1970-01-01 09:00:00.000000000 +0900 +++ ghostscript-8.71~dfsg2/debian/update-gsfontmap 2010-05-18 21:30:21.000000000 +0900 @@ -0,0 +1,20 @@ +#!/bin/sh +# update-gsfontmap +# Copyright 2010 Kenshi Muto <[email protected]> +# License: GPL + +CIDFMAP=/var/lib/ghostscript/fonts/cidfmap +FONTMAP=/var/lib/ghostscript/fonts/Fontmap +CIDFDIR=/etc/ghostscript/cidfmap.d/ +FONTMDIR=/etc/ghostscript/fontmap.d/ + +rm -f $CIDFMAP $FONTMAP +touch $CIDFMAP $FONTMAP + +for i in $CIDFDIR/*.conf; do + cat $i >> $CIDFMAP +done 2>/dev/null + +for i in $FONTMDIR/*.conf; do + cat $i >> $FONTMAP +done 2>/dev/null

