summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/ai
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/fonts/ai')
-rw-r--r--Master/texmf-dist/doc/fonts/ai/README82
-rw-r--r--Master/texmf-dist/doc/fonts/ai/processfonts32
-rw-r--r--Master/texmf-dist/doc/fonts/ai/remap117
3 files changed, 231 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/fonts/ai/README b/Master/texmf-dist/doc/fonts/ai/README
new file mode 100644
index 00000000000..59b8c256b32
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/ai/README
@@ -0,0 +1,82 @@
+AI Font Distribution
+Copyright 1999 Bernard Collins <bernard.collins@jhuapl.edu>
+
+Last modified 17 October 2001.
+
+This program can redistributed and/or modified under the terms of the
+LaTeX Project Public License, either version 1.2 of this License or
+(at your option) any later version.
+
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.2 or later is part of all distributions of LaTeX version
+1999/12/01 or later.
+
+INTRODUCTION
+
+The purpose of the AI font distribution is to improve the final
+conversion to Postscript and PDF formats of TeX documents which use
+the standard Computer Modern and AMS fonts. It should allow most
+modern TeX postprocessors, including dvips, dvipdfm, and pdftex (not
+exactly a postprocessor), to generate PS and PDF which avoids bugs in
+some document readers on some platforms and which can be imported
+easily into third-party software, such as Adobe Illustrator.
+
+INSTALLATION AND USE
+
+The following instructions are intended for teTeX based systems. You
+should not have too much trouble adapting them to other distributions.
+All files should unpack into appropriate sub-directories according to
+the TeX directory standard used by teTeX, et al. The top-level
+directory is named texmf. You may safely unpack into your main texmf
+tree, or into your $HOME/texmf. Copy the bash scripts from
+texmf/ai/bin to a directory in your path. Run texhash, and you are
+ready to go! The three scripts aidvips, aipdftex, and aipdflatex are
+set up to allow easy access to the fonts. Aidvips remaps fonts using
+one of the following command-line options:
+
+-Pai Remap low characters, but do not embed any fonts
+-Paiz (default) Remap low characters, embedding re-encoded
+ BSR/Y&Y/AMS fonts
+
+SOME DETAILS
+
+There is one .vf file for each of the BSR/Y&Y/AMS Computer Modern and
+AMS publicly released Type 1 fonts. The corresponding .tfm files are
+not included, as the standard CM/AMS .tfm files should be used. This
+ensures that TeX processing will be unaffected by these fonts, since
+TeX never uses .vf files. Each virtual font maps all characters in a
+standard .tfm file to another special .tfm file, included in the
+distribuiton. Each standard metric file has a corresponding remapped
+file which is named by prepending "ai" to the standard name. For
+example, each character in cmr10.tfm is mapped, through cmr10.vf, to a
+character in aicmr10.tfm. The content of aicmr10.tfm is identical to
+cmr10.tfm, except that characters in the "control-character" range,
+0-32 and 127, have been remapped to higher postions in the range
+161-196. Ligature and kerning information is updated to reflect the
+change. The BSR/Y&Y/AMS Type 1 fonts doubly encode these characters in
+the higher positions for just this purpose. This avoids problems with
+some software when interpretting the final PS or PDF file.
+
+Adobe Illustrator can directly interpret postscript output from dvips
+using Type 1 Computer Modern fonts that have been remapped with the ai
+virtual fonts. This is safer than using the "-G" command line or "G"
+configuration file option in dvips because it allows any of the 128
+standard BSR/Y&Y/AMS fonts to be intermixed with ordinary text Type 1
+fonts such as Times and Helvetica. If you save imported dvips
+postsript in Illustrator .ai or .eps format, AI might have a problem
+reopening the file, giving an error about invalid font remapping. But
+if you save the file in .pdf format, AI can re-open it without a
+problem. At least this is true for Illustrator 7, which is the latest
+version I have.
+
+The package includes a couple of perl scripts in texmf/doc/fonts/ai/
+that were used to generate the virtual fonts. It should be possible to
+use these scripts to process other similar doubly-encoded fonts which
+may include the BaKoMa fonts or Taco Hoekwater's fonts.
+
+CHANGES
+
+Version 1.2 adds bsr.map and modifies the shell scripts in order to
+make the ai virtual fonts work easily with the latest TeX Live
+distribution (July 2001).
diff --git a/Master/texmf-dist/doc/fonts/ai/processfonts b/Master/texmf-dist/doc/fonts/ai/processfonts
new file mode 100644
index 00000000000..506416ffbb4
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/ai/processfonts
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+# Written by Skip Collins <bernard.collins@jhuapl.edu>
+use Cwd;
+$currentdir = cwd;
+$remaptmp = "/var/tmp/remaptmp";
+mkdir($remaptmp, 0777);
+$configfiles[0]=`kpsewhich -format="dvips config" psfonts.cm`;
+$configfiles[1]=`kpsewhich -format="dvips config" psfonts.ams`;
+$fontlist = "";
+$i=0;
+foreach $cfg (@configfiles) {
+ open(INPUT,$cfg) || die "Can't open font list";
+ while (<INPUT>) {
+ $string = $_;
+ $string =~ s/\s*\w*\s*$//;
+ $fontlist[$i] = $string;
+ $i++;
+ }
+ close(INPUT);
+}
+chdir($remaptmp);
+foreach $i (@fontlist) {
+ system("tftopl -charcode-format=octal $i $i");
+ system("remap $i");
+ system("vptovf $i");
+ system("pltotf ai$i");
+ system("mv ai$i.tfm $currentdir");
+ system("mv $i.vf $currentdir");
+}
+
+#system("rm -rf $remaptmp");
diff --git a/Master/texmf-dist/doc/fonts/ai/remap b/Master/texmf-dist/doc/fonts/ai/remap
new file mode 100644
index 00000000000..776132e5e5c
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/ai/remap
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# Written by Skip Collins <bernard.collins@jhuapl.edu>
+
+use File::Basename;
+@plsuffixlist = "\.pl";
+@vplsuffixlist = "\.vpl";
+
+if ( ($#ARGV<0)||($#ARGV>2) || ($ARGV[0] =~ "-help")) {
+ print "Usage: remap PLFILE[.pl] [AIPLFILE[.pl] [VPLFILE[.vpl]]]\n";
+ print " Translate PLFILE to AIPLFILE and companion VPLFILE.\n";
+ print " Default AIPLFILE is aiPLFILE.pl.\n";
+ print " Default VPLFILE is PLFILE.vpl.\n";
+ print "\n";
+ print "--help display this help and exit\n";
+} else {
+ ($plbasename, $plpath, $plsuffix) = fileparse($ARGV[0], @plsuffixlist);
+ if ($plsuffix eq "") {
+ $plsuffix = "\.pl";
+ }
+ $plfile = $plpath.$plbasename.$plsuffix;
+ if ($#ARGV >= 1) {
+ ($aiplbasename, $aiplpath, $aiplsuffix) = fileparse($ARGV[1], @plsuffixlist);
+ if ($aiplsuffix eq "") {
+ $aiplsuffix = "\.pl";
+ }
+ $aiplfile = ">".$aiplpath.$aiplbasename.$aiplsuffix;
+ $mapname = $aiplbasename;
+ if ($#ARGV == 2) {
+ ($vplbasename, $vplpath, $vplsuffix) = fileparse($ARGV[2], @vplsuffixlist);
+ if ($vplsuffix eq "") {
+ $vplsuffix = "\.vpl";
+ }
+ $vplfile = ">".$vplpath.$vplbasename.$vplsuffix;
+ } else {
+ $vplfile = ">".$plpath.$plbasename."\.vpl";
+ }
+ } else {
+ $aiplfile = ">".$plpath."ai".$plbasename."\.pl";
+ $vplfile = ">".$plpath.$plbasename."\.vpl";
+ $mapname = "ai".$plbasename;
+ }
+ open(INPUT, $plfile) || die "Can't open $plfile.";
+ open(OUTPUT_PL, $aiplfile) || die "Can't open $aiplfile.";
+ open(OUTPUT_VPL, $vplfile) || die "Can't open $vplfile.";
+ $sevenbitflag = "FALSE";
+ while (<INPUT>) {
+ $string = $_;
+ if ($string =~ /\(CHECKSUM/) {
+# Ooops. FONTCHECKSUM should refer to the mapped font, not this font.
+# Maybe it's best to leave it empty.
+# $mapchecksum = $string;
+# $mapchecksum =~ s/\s*\(CHECKSUM\s*O\s*//;
+# $mapchecksum =~ s/\)\s*//;
+ } else {
+ print OUTPUT_VPL "$string";
+ $plstring = $string;
+ if (!($string =~ /\(FACE|\(HEADER|\(SKIP|\(TOP O 0\)|\(MID O 0\)|\(BOT O 0\)/)) {
+ $plstring =~ s/\sO\s[0-7]+/shift_octal_numbers($&)/ge;
+ if ($string =~ /\(DESIGNSIZE/) {
+ $mapdsize = $string;
+ $mapdsize =~ s/\s*\(DESIGNSIZE\s*R\s*//;
+ $mapdsize =~ s/\)\s*//;
+ print OUTPUT_VPL "(MAPFONT O 0\n";
+ print OUTPUT_VPL " (FONTNAME $mapname)\n";
+# print OUTPUT_VPL " (FONTCHECKSUM O $mapchecksum)\n";
+ print OUTPUT_VPL " (FONTAT R 1.0)\n";
+ print OUTPUT_VPL " (FONTDSIZE R $mapdsize)\n";
+ print OUTPUT_VPL " )\n";
+ } elsif ($string =~ /\(CHARACTER/) {
+ $mapchar = $string;
+ $mapchar =~ s/\s*\(CHARACTER\s*O\s*//;
+ $mapchar =~ s/\s*$//;
+ $mapchar = " O $mapchar";
+ $newmapchar = shift_octal_numbers($mapchar);
+# Originally, I wanted only to remap problematic characters. But, in
+# order to minimize the number of duplicate references to external fonts
+# and therefore reduce the likelihood of uncovering subtle bugs in ps/pdf
+# output, I will instead map all characters in the virtual font.
+# if ($newmapchar ne $mapchar) {
+ print OUTPUT_VPL " (MAP\n";
+ print OUTPUT_VPL " (SETCHAR$newmapchar)\n";
+ print OUTPUT_VPL " )\n";
+# }
+ } elsif ($string =~ /\(SEVENBITSAFEFLAG/) {
+ $sevenbitflag = "TRUE";
+ }
+ }
+ print OUTPUT_PL "$plstring";
+ }
+ }
+# SEVENBITSAFEFLAG does not seem to take. So, for some fonts, the round-trip
+# tfm->pl->vpl->tfm->pl results in slightly different start and finish .tfm/.pl
+# files. This does not seem to matter in the end.
+ print OUTPUT_VPL "(SEVENBITSAFEFLAG $sevenbitflag)\n";
+ close(INPUT);
+ close(OUTPUT_PL);
+ close(OUTPUT_VPL);
+}
+
+sub shift_octal_numbers {
+ local($string) = $_[0];
+ $onumber = substr($string, 3, 20);
+ $dnumber = oct($onumber);
+ if (($dnumber <= 0x20) && ($dnumber >= 0)) {
+ if ($dnumber < 0x0A) {
+ $dnumber += 0xA1;
+ }
+ else {
+ $dnumber += 0xA3;
+ }
+ }
+ elsif ($dnumber == 0x7F) {
+ $dnumber = 0xC4;
+ }
+ return " O ".sprintf("%o", $dnumber);
+}