diff options
author | Staszek Wawrykiewicz <staw@gust.org.pl> | 2006-12-18 04:07:08 +0000 |
---|---|---|
committer | Staszek Wawrykiewicz <staw@gust.org.pl> | 2006-12-18 04:07:08 +0000 |
commit | 0e962221eacc2619b49538f1434dc88c237c0f4b (patch) | |
tree | ed0c79f10c67bdbc753a810eaf177617a997d7c2 /Master/bin/win32/fixmacps.bat | |
parent | ecb7a4e0b6c82b917815412a2589cb3f373f23d4 (diff) |
new binaries for w32
git-svn-id: svn://tug.org/texlive/trunk@2780 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/win32/fixmacps.bat')
-rw-r--r-- | Master/bin/win32/fixmacps.bat | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/Master/bin/win32/fixmacps.bat b/Master/bin/win32/fixmacps.bat new file mode 100644 index 00000000000..1f300346175 --- /dev/null +++ b/Master/bin/win32/fixmacps.bat @@ -0,0 +1,105 @@ +@rem = '-*- Perl -*-
+@echo off
+perl -S %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+goto endofperl
+';
+
+# fixmacps: swap to sanitised appledict
+#
+# Copyright (C) Angus J. C. Duggan 1991-1995
+# See file LICENSE for details.
+
+$sysdir = `kpsewhich --progname=dvips --format="other text files" md71_0.ps` ;
+chomp($sysdir) ;
+$sysdir =~ s/\/md71_0\.ps// ;
+
+$line = 0; # keep line count
+$dir = $sysdir ;
+$prefix = "md";
+$default = "md71_0.ps";
+
+while ($_ = shift(@ARGV)) {
+ if (/^-d(ir)?$/) { $dir = shift(@ARGV); }
+ elsif (/^-n(ame)?$/) { $prefix = shift(@ARGV); }
+ else {
+ unshift(@ARGV, $_);
+ last;
+ }
+}
+
+%fonts = ();
+$nesting = 0;
+
+while (<>) {
+ if (/^%!/) {
+ if (! $line) {
+ print;
+ }
+ } elsif (/^%%(Begin|Include)ProcSet: "?\(AppleDict md\)"? ([0-9]+) ([0-9]+)$/) {
+ local($inc, $mdv, $mdr) = ($1, $2, $3);
+ if (open(SANE, "<$dir/$prefix${mdv}_$mdr.ps") ||
+ open(SANE, "<$dir/$default")) {
+ $sane = <SANE>;
+ local($snv, $snr) =
+ $sane =~ /^%%BeginProcSet: \(AppleDict md\) ([0-9]+) ([0-9]+)$/;
+ if ($mdv == $snv && $mdr == $snr) {
+ if ( $inc eq "Include" ) {
+ print STDERR "Inserting ProcSet \"(AppleDict md)\" $snv $snr\n";
+ print $sane;
+ while(<SANE>) {
+ print;
+ }
+ close(SANE);
+ }
+ else {
+ print STDERR "Substituting ProcSet \"(AppleDict md)\" $snv $snr\n";
+ $ignore = 1;
+ }
+ } else {
+ print STDERR "Unrecognised AppleDict version $mdv $mdr\n";
+ print "%!\n" if !$line;
+ print;
+ }
+ } else {
+ print STDERR "Can't find sanitised AppleDict\n";
+ print "%!\n" if !$line;
+ print;
+ }
+ } elsif (/^%%EndProcSet/) {
+ if ($ignore) {
+ $ignore = 0;
+ print "%!\n" if !$line;
+ print $sane;
+ while(<SANE>) {
+ print;
+ }
+ close(SANE);
+ } else {
+ print "%!\n" if !$line;
+ print;
+ }
+ } elsif (/^%%Page:/ && $nesting == 0) {
+ print $_;
+ print values(%fonts);
+ } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) {
+ print $_;
+ $nesting++;
+ } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) {
+ print $_;
+ $nesting--;
+ } else {
+ if (! $ignore) {
+ if (/^\{\}mark .*rf$/) {
+ $fonts{$_} = $_;
+ print;
+ } else {
+ print "%!\n" if !$line;
+ print;
+ }
+ }
+ }
+ $line++;
+}
+__END__
+:endofperl
+
|