diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/psfonts/corelpak/contrib |
Initial commit
Diffstat (limited to 'fonts/psfonts/corelpak/contrib')
-rw-r--r-- | fonts/psfonts/corelpak/contrib/README | 53 | ||||
-rwxr-xr-x | fonts/psfonts/corelpak/contrib/translate-font.pl | 71 | ||||
-rwxr-xr-x | fonts/psfonts/corelpak/contrib/translate-font.pl,v | 133 | ||||
-rw-r--r-- | fonts/psfonts/corelpak/contrib/transtabl | 80 |
4 files changed, 337 insertions, 0 deletions
diff --git a/fonts/psfonts/corelpak/contrib/README b/fonts/psfonts/corelpak/contrib/README new file mode 100644 index 0000000000..26e4722b20 --- /dev/null +++ b/fonts/psfonts/corelpak/contrib/README @@ -0,0 +1,53 @@ +This README describes the files in CTAN:fonts/psfonts/corelpak/contrib, +a file renaming tool for commercial corelpak font files. + +Author: Karsten Tinnefeld <karsten@tinnefeld.com> +Changed: 1999-01-12 +Files: +-rw-r--r-- 2310 Jan 12 16:56 README (this file) +-r-xr-xr-x 1842 Jan 12 16:37 translate-font.pl (perl script) +-r-xr-xr-x 2524 Jan 12 16:52 translate-font.pl,v (rcs archive) +-rw-r--r-- 1224 Jan 12 16:13 transtabl (ascii database) + +For renaming the .pfb and .afm files that come with Corel software, a half +automatic tool is work in progress. You can try the first version by +putting the files translate-font.pl and transtabl into one writable +directory in your PATH. Modify the first line of translate-font.pl to match +the location of your Perl interpreter. At first startup you will be +asked for a mountpoint for the CD, enter /cdrom/ or f:\ or the like. +This will be checkpointed in a file called mountpoint. Remove this +file in order to use another mount point. Call translate-font.pl in +either one of the following two ways: + + translate-font.pl PATTERN + +this will scan the font directories for all fonts that match the PATTERN +and output their names (if extractable from the .pfb file). PATTERN +must begin with a letter in [a-z] and may contain wildcards, thus +'amri*' will output the names of the amerigo fonts. Take care to hide +the wildcards from prior shell expansion by using single quotes of +backslashification. + + translate-font.pl PATTERN pfb or + translate-font.pl PATTERN afm + +this will copy any matching font to the current directory, provided +their names are already known in »transtabl«. This file consists of +lines that list the original font name followed by white space +followed by the tex font name (without suffixes). I hope, the names do +not differ from one Corel version to the other. + +You will find the correct tex font name in Karl Berry's fontname files +(CTAN:doc/fontname/). They might not in any case match the names in the +.map files in this distribution, however. + +This tool is not expected to work under DOS at the moment, not even if +you have the head, tail and strings programs installed. This will change +only by your aid. + +Please send me any font translation rules you have added, hints about +bugs and errors to Karsten Tinnefeld <karsten@tinnefeld.com>. + +Please note that corelpak-contrib does not, will not and never has included +any third hand copyrighted material, be it names, strokes, measurements or +whatever. diff --git a/fonts/psfonts/corelpak/contrib/translate-font.pl b/fonts/psfonts/corelpak/contrib/translate-font.pl new file mode 100755 index 0000000000..ab85ef4196 --- /dev/null +++ b/fonts/psfonts/corelpak/contrib/translate-font.pl @@ -0,0 +1,71 @@ +#!/app/unido-inf/sun4_55/perl/5.004.03/bin/perl + +die "Syntax: $0 pattern [suffix]\n" if ($#ARGV == -1 || $#ARGV > 1); + +use Cwd qw/cwd/; +use File::Copy qw/cp/; +use File::Basename qw(dirname); + +$destination=cwd(); +$prgdir = dirname $0; + +$tblfile = $prgdir . "/transtabl"; +$mntfile = $prgdir . "/mountpoint"; + +if (open CDMNT, $mntfile) { + $cd = <CDMNT>; + chop $cd; + close CDMNT; +} else { + print "Please enter a mountpoint (or device letter) for the Corel CD.\n: "; + $cd = <STDIN>; + chop $cd; + die "No such directory: $cd.\n" unless -d $cd; + system "echo $cd > $mntfile"; +} +$fontdir="$cd/fonts/type1"; + +open TBL, $tblfile or die "$tblfile - $!"; +while ($entry = <TBL>) { + next if length($entry) == 1 or $entry =~ /^#/; + + ($key, $name) = split /\s+/, $entry; +# print "Translation of $key is $name.\n"; + @translation{$key} = $name; +} +close TBL; + +$searchname=$ARGV[0]; +$firstchar=substr $searchname, 0, 1; +$firstchar =~ /[a-z]/ or die "$searchname doesn't start with letter.\n"; + +chdir "$fontdir/$firstchar" or die "cannot cd to $fontdir/$firstchar.\n"; + +@files = glob $searchname; + +$justscan = not ($suffix = $ARGV[1]); +print "Obtaining .$suffix-suffixed files.\n" unless $justscan; + +foreach $file (@files) { + next if ($file !~ m/pfb$/); + $head = `strings $file | head -1`; + (undef, $name, undef) = split " ", $head; + print "»$file«:", " " x (15 - length $file), "$name\n"; +} + +exit if $justscan; + +foreach $file (@files) { + + next if ($file !~ /$suffix$/); + + ($rawfile) = split /.$suffix$/, $file; + if (not defined $translation{$rawfile}) { + print "»$file«:", " " x (15 - length $file), + "Translation ($rawfile) unknown, skipping.\n"; + next; + } + $destfile = "$translation{$rawfile}.$suffix"; + print "Copying $file to $destfile.\n"; + cp $file, "$destination/$destfile"; +} diff --git a/fonts/psfonts/corelpak/contrib/translate-font.pl,v b/fonts/psfonts/corelpak/contrib/translate-font.pl,v new file mode 100755 index 0000000000..aeb723c2e1 --- /dev/null +++ b/fonts/psfonts/corelpak/contrib/translate-font.pl,v @@ -0,0 +1,133 @@ +head 1.3; +access; +symbols; +locks; strict; +comment @# @; + + +1.3 +date 99.01.12.15.52.33; author tinne; state Exp; +branches; +next 1.2; + +1.2 +date 99.01.08.11.30.25; author tinne; state Exp; +branches; +next 1.1; + +1.1 +date 99.01.08.09.13.53; author tinne; state Exp; +branches; +next ; + + +desc +@@ + + +1.3 +log +@Added Shorthelp, use some more perl modules but shell commands. +@ +text +@#!/app/unido-inf/sun4_55/perl/5.004.03/bin/perl + +die "Syntax: $0 pattern [suffix]\n" if ($#ARGV == -1 || $#ARGV > 1); + +use Cwd qw/cwd/; +use File::Copy qw/cp/; +use File::Basename qw(dirname); + +$destination=cwd(); +$prgdir = dirname $0; + +$tblfile = $prgdir . "/transtabl"; +$mntfile = $prgdir . "/mountpoint"; + +if (open CDMNT, $mntfile) { + $cd = <CDMNT>; + chop $cd; + close CDMNT; +} else { + print "Please enter a mountpoint (or device letter) for the Corel CD.\n: "; + $cd = <STDIN>; + chop $cd; + die "No such directory: $cd.\n" unless -d $cd; + system "echo $cd > $mntfile"; +} +$fontdir="$cd/fonts/type1"; + +open TBL, $tblfile or die "$tblfile - $!"; +while ($entry = <TBL>) { + next if length($entry) == 1 or $entry =~ /^#/; + + ($key, $name) = split /\s+/, $entry; +# print "Translation of $key is $name.\n"; + @@translation{$key} = $name; +} +close TBL; + +$searchname=$ARGV[0]; +$firstchar=substr $searchname, 0, 1; +$firstchar =~ /[a-z]/ or die "$searchname doesn't start with letter.\n"; + +chdir "$fontdir/$firstchar" or die "cannot cd to $fontdir/$firstchar.\n"; + +@@files = glob $searchname; + +$justscan = not ($suffix = $ARGV[1]); +print "Obtaining .$suffix-suffixed files.\n" unless $justscan; + +foreach $file (@@files) { + next if ($file !~ m/pfb$/); + $head = `strings $file | head -1`; + (undef, $name, undef) = split " ", $head; + print "»$file«:", " " x (15 - length $file), "$name\n"; +} + +exit if $justscan; + +foreach $file (@@files) { + + next if ($file !~ /$suffix$/); + + ($rawfile) = split /.$suffix$/, $file; + if (not defined $translation{$rawfile}) { + print "»$file«:", " " x (15 - length $file), + "Translation ($rawfile) unknown, skipping.\n"; + next; + } + $destfile = "$translation{$rawfile}.$suffix"; + print "Copying $file to $destfile.\n"; + cp $file, "$destination/$destfile"; +} +@ + + +1.2 +log +@added dos specific comment. +@ +text +@d3 1 +a3 1 +use File::Copy "cp"; +d5 6 +a10 2 +$cwd=`pwd`; chop $cwd; +$prgdir = `dirname $0`; chop $prgdir; +d70 1 +a70 1 + cp $file, "$cwd/$destfile"; +@ + + +1.1 +log +@Initial revision +@ +text +@d16 1 +a16 1 + print "Please enter a mountpoint for the Corel CD.\n: "; +@ diff --git a/fonts/psfonts/corelpak/contrib/transtabl b/fonts/psfonts/corelpak/contrib/transtabl new file mode 100644 index 0000000000..f1bfde4318 --- /dev/null +++ b/fonts/psfonts/corelpak/contrib/transtabl @@ -0,0 +1,80 @@ +# Conversion table (begun) for the Fonts contained in the Corel pack. +# They are named: Official Name (Bitstream-Name, if not identical) +# +# created 1999-01-07 Karsten Tinnefeld <karsten@tinnefeld.com> +# +# changed 1999-03-09: corrected some encoding names, (kt) +# changed names to fit for fontinst. +# added Letter Gothic. + +# Amerigo +amrigob beob8a +amrigobi beobi8a +amrigom beom8a +amrigomi beomi8a +amrigon beor8a +amrigoi beori8a + +# Cheltenham +chlthmb bctb8a +chltboc bctb8an +chltboxc bctb8aq +chltboa bctbd8a +chltboia bctbid8a +chlthmbi bctbi8a +chltboci bctbi8an +chlthmn bctr8a +chlthmi bctri8a + +# Garamond (ITC Garamond) +garamdb bgmb8a +garamdbc bgmb8an +garamdbi bgmbi8a +garambci bgmbi8an +garamdn bgmk8a +garamdnc bgmk8an +garamdni bgmki8a +garamnci bgmki8an + +# Trump Mediaeval (Kuenstler 480) +kuen408b btvb8a +kue408bi btvbi8a +kuen408k btvc8a +kuen408n btvr8a +kuen408i btvri8a + +# Letter Gothic 12 Pitch +legot12b blgb8a +lego12bi blgbi8a +letgot12 blgr8a +legot12i blgri8a + +# Schneidler +schndlb bssb8a +schndlbi bssbi8a +schndlk bssc8a +schndlki bssci8a +schndll bssl8a +schndlli bssli8a +schndlm bssm8a +schndlmi bssmi8a +schndln bssr8a +schndli bssri8a + +# Tiffany (ITC Tiffany) +tifanyd btfd8a +tifanydi btfdi8a +tifanyh btfh8a +tifanyhi btfhi8a +tifanyl btfl8a +tifanyli btfli8a + +# Optima (Zapf Humanist 601) +zhum601b bopb8a +zhu601bi bopbi8a +zhum601d bopd8a +zhu601di bopdi8a +zhum601n bopr8a +zhum601i bopri8a +zhum601u bopu8a +zhu601ui bopui8a |