summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttf2pt1/other/showdf
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/ttf2pt1/other/showdf')
-rw-r--r--Build/source/texk/ttf2pt1/other/showdf58
1 files changed, 58 insertions, 0 deletions
diff --git a/Build/source/texk/ttf2pt1/other/showdf b/Build/source/texk/ttf2pt1/other/showdf
new file mode 100644
index 00000000000..1706a81454d
--- /dev/null
+++ b/Build/source/texk/ttf2pt1/other/showdf
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+if (@ARGV != 3) {
+ print STDERR "Use:\n";
+ print STDERR " showdf <showg-script> <old-file> <new-file>\n";
+ print STDERR "to create a showg diagram of glyphs differing in two files\n";
+ exit 1;
+}
+
+$cmd = shift @ARGV;
+$oldf = shift @ARGV;
+$newf = shift @ARGV;
+
+open(O, "<$oldf") or die "Unable to open '$oldf'\n";
+open(N, "<$newf") or die "Unable to open '$newf'\n";
+
+while(<O>) {
+ last if(/CharStrings/);
+}
+while(<N>) {
+ last if(/CharStrings/);
+}
+
+undef @symlist;
+$sym = '';
+$inlist = 0;
+$nstop = 0;
+
+while($so = <O>) {
+ if($so =~ m|^(/\S+)\s+\{|) {
+ $sym = $1;
+ $inlist = 0;
+ #printf STDERR "found sym $sym\n";
+ if (!$nstop || $sn !~ m|^$sym\s+\{|) {
+ while($sn = <N>) {
+ #print STDERR "+$sn";
+ last if($sn =~ m|^${sym}\s+\{|);
+ }
+ }
+ $nstop = 0;
+ } elsif(!$nstop) {
+ $sn = <N>;
+ #print STDERR "<$so>$sn\n";
+ if($so ne $sn) {
+ if(!$inlist) {
+ $inlist = 1;
+ push(@symlist, $sym);
+ }
+ if($sn =~ m|^(/\S+)\s+\{|) {
+ $nstop = 1;
+ #printf STDERR "stop at $1\n";
+ }
+ }
+ }
+}
+unshift(@symlist, $cmd, '-c', $oldf, $newf);
+#printf("%s\n", join(' ', @symlist));
+exec @symlist;