PHP Classes
elePHPant
Icontem

File: application/libraries/dompdf/lib/ttf2ufm/src/other/showdf

Recommend this page to a friend!
  Classes of harold rita  >  PHP Thesis Proposal Hub  >  application/libraries/dompdf/lib/ttf2ufm/src/other/showdf  >  Download  
File: application/libraries/dompdf/lib/ttf2ufm/src/other/showdf
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Thesis Proposal Hub
Store and publish research thesis documents
Author: By
Last change:
Date: 1 year ago
Size: 1,124 bytes
 

 

Contents

Class file image Download
#!/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;