[comp.sources.misc] v19i094: untype1 - PostScript Type 1 Font Decryption, Part01/01

sears@Decwrl.dec.com (Chris Sears) (05/19/91)

Submitted-by: Chris Sears <sears@Decwrl.dec.com>
Posting-number: Volume 19, Issue 94
Archive-name: untype1/part01

    These utilities decrypt an Adobe Type 1 font and leave a raw PostScript
file as a result.  Most of this procedure is documented in the Adobe Black 
Book,"Adobe Type 1 Font Format."

    The purpose here is both to have a tool that can be used for decrypting
fonts into a format more palatable for graphics programs to ingest directly
and also as a reference implementation for PostScript interpreters.
that end, I try to be more clear than efficient.

    For the most part untype1 is now unimportant, as the new releases of the
Adobe PostScript interpreters, for example, Display PostScript release 1006.9,
use unprotected versions of the built-in fonts.  You can't get at the high
resolution versions from a low-resolution interpreter but using Display
PostScript directly is a LOT easier to work with.

    Chris Sears
    sears@decwse.pa.dec.com
-----
#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 04/30/1991 23:47 UTC by sears@blofeld.pa.dec.com
# Source directory /nfs/catacomb/cc1/sears/untype1
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#    350 -rw-rw-rw- Makefile
#   9436 -rw-r--r-- README
#   5787 -rw-r--r-- chars.c
#   1833 -rw-rw-rw- eexec.c
#   5109 -rw-r--r-- untype1_header.ps
#   1639 -rw-r--r-- untype1_trailer.ps
#    764 -rwxr-xr-x untype1
#   9054 -rw-r--r-- un-adobe.hqx
#     81 -rw-r--r-- view_header.ps
#   1031 -rw-r--r-- view_trailer.ps
#   1661 -rw-r--r-- reenc.ps
#     21 -rw-r--r-- patchlevel.h
#
# ============= Makefile ==============
if test -f 'Makefile' -a X"$1" != X"-c"; then
	echo 'x - skipping Makefile (File already exists)'
else
echo 'x - extracting Makefile (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
CFLAGS = -O
X
all:	eexec chars
X
eexec:	eexec.c
X	cc ${CFLAGS} -o eexec eexec.c
X
chars:	chars.c
X	cc ${CFLAGS} -o chars chars.c
X
clean:
X	rm -f eexec.o chars.o eexec chars untype1.shar
X
shar:
X	shar Makefile README chars.c eexec.c untype1_header.ps untype1_trailer.ps untype1 un-adobe.hqx view_header.ps view_trailer.ps reenc.ps patchlevel.h >untype1.shar
SHAR_EOF
chmod 0666 Makefile ||
echo 'restore of Makefile failed'
Wc_c="`wc -c < 'Makefile'`"
test 350 -eq "$Wc_c" ||
	echo 'Makefile: original size 350, current size' "$Wc_c"
fi
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
	echo 'x - skipping README (File already exists)'
else
echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
untype1 - Adobe Type 1 Font Decryption
X
Chris B. Sears
sears@pa.dec.com
Digital Equipment Corporation
May 31, 1990
X
INTRODUCTION
X
X    These utilities decrypt an Adobe Type 1 font and leave a raw PostScript
file as a result.  Most of this procedure is documented in the Adobe Black Book,
"Adobe Type 1 Font Format."  It can be ordered directly from Adobe Systems.
This book is referenced here and in the code as the Black Book.
X
X    The purpose here is both to have a tool that can be used for decrypting
fonts into a format more palatable for graphics programs to ingest directly
and also as a reference implementation for PostScript interpreters.  Towards
that end, I try to be more clear than efficient.
X
POSTSCRIPT RESULTS
X
X    The result of untype1 is a very simple PostScript file containing only:
X
X        /name
X        integers
X        closepath
X        curveto
X        lineto
X        moveto
X        def
X        { }
X
X    Each character outline becomes a single PostScript procedure:
X
X	0. the first three definitions are the Copyright, Notice and FullName.
X    1. each procedure occupies a single line.  Lines can be very long.
X    2. the syntax is very simple PostScript, easily parsed by a yacc/lex filter.
X    3. all arguments directly precede the PostScript command.
X    4. the variable charWidth is set to the width of the character.
X    5. the procedure creates a path corresponding to the character.
X    6. the font bounding box is generally based on a 1000x1000 FontBBox.
X
X    For example:
X
X        /period { /charWidth 287 def 79 52 moveto 79 18 109 -12 143 -12 curveto 177 -12 207 18 207 52 curveto 207 86 177 116 143 116 curveto 109 116 79 86 79 52 curveto closepath 79 52 moveto } def
X
X    The trailing moveto is hard to get rid of.  It is an artifact of the
semantics of the Type 1 closepath definition which leaves the currentpoint
in the path.  See page 51 of the Black Book.  It is easily ignored.
Note that with GhostScript 2.0, the moveto is omitted.
X
USING UNTYPE1
X
X    Converting a Type 1 font program into the outlines is done in two phases.
It assumes that you have a Macintosh, a Unix system and Display Postscript.
NeWS, GhostScript or a LaserWriter can be used to interpret as well.
PostScript that I use is pretty simple, but the implementation limits of
other systems may break this approach.
X
X    1. Using un-adobe, which is in hqx format, convert the Type 1 font into
X       a eexec encoded text file.  Un-adobe.hqx was snarfed off of SUMEX.
X    2. Using untype1, a shell script driver, convert the results into a list
X       of simple PostScript programs.
X
X    Here is a description of the files in this directory:
X
X    untype1
X        a shell script that uses eexec, chars and DPStest to take
X        an ASCII PostScript PostScript file with an encrypted Adobe Type 1
X        font and generate raw PostScript for the font
X    Makefile
X        a make(1) description file for compiling exec.c and chars.c
X    eexec.c
X        decrypts a font file encrypted for the eexec operator
X    chars.c
X        decrypts a font file of encrypted CharStrings.  chars couldn't
X        easily be written to accept standard input because it repositions
X        itself with fseek() after a charstring has been decrypted.
X    untype1_header.ps
X    untype1_trailer.ps
X        PostScript wrappers that remove font hints, squash procedures
X        and transform operators and operands.
X    un-adobe.hqx
X        a Macintosh application that converts an Adobe PostScript
X        font into an ASCII file for transfer to a UNIX system
X    view_header.ps
X    view_trailer.ps
X        After converting a Type 1 file, these files can be used
X        for viewing the results with Display PostScript.
X
X    To decrypt a Type 1 font first transform the Adobe font file into a text
file on a Macintosh.  This can be done with the Macintosh program in unadobe.hqx
written by Jerry Keough and Ted Ede at Mitre Corporation.  Next transfer the
encrypted PostScript file from the Macintosh to your UNIX system with a file
transfer utility like NCSA Telnet or Kermit.  Be sure to transfer this file in
text mode and *not* binary mode).  Once the font file is on your UNIX system,
you can perform the decryption with the shell script untype1.
X
X    untype1 is basically three pass: it runs eexec and chars, wraps the output
with untype1_header.ps and untype1_trailer.ps and then runs it through Display
PostScript.  To interact with Display PostScript we use dpstest(1X) found in
/usr/examples/dps/dpstest in the Ultrix release.
X
X    view_header.ps and view_trailer.ps are useful for displaying the font
using Display PostScript. Concatenate view_header.ps, the font file and
view_trailer.ps together.  The results can be viewed with DPStest.
X
CURRENT BUGS AND LIMITATIONS
X
X    1. I don't understand the Type 1 sbw command.  The y component of the
X       width vector is currently ignored.  What fonts use this, Kanji?
X    2. Using GhostScript as the interpreter doesn't work entirely because
X       GhostScript hasn't completely implemented save/restore semantics.
X       These are used by hybrid fonts such as Optima which have hires and
X       lowres dictionaries.  Non-hybrid fonts work.  The work around is to
X       use the hires version.  Redefining dtransform fakes the font program
X       into thinking that it is on a 2540 dpi device.  GhostScript is about
X       10 times faster than Display PostScript.
X    3. GhostScript omits the trailing moveto.
X    4. FontBBox or FontMatrix aren't parsed.  Actually, not much is.
X    5. Kevin O'Gorman reports that he gets VMErrors on a LaserWriter.
X
COPYRIGHT NOTICE
X
Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts.
X
X                       All Rights Reserved
X
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
X
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
X
RELEASE NOTES AND CHANGES
X
November 9, 1990
X
StoneSerif used " -| " rather than " RD " to read the encrypted charstrings.
There is a bug with seac where the x origin of accented characters is wrong.
Renamed the shell script transform to untype1.
The untype1_header.ps and untype1_trailer.ps files were substantially revised
to use the pathforall operator.  This resulted in much simple code and the
resulting PostScript output was much simpler still.  Used bind def.
X
November 15, 1990
X
Added charWidth definitions to the resulting procedures.
Changed view_trailer.ps to underline the width on the baseline.
Added flattenpath and setflat but commented it out.
The setflat parameter should probably be increased to reduce the number
of line segments in a flattened character outline.
X
November 19, 1990
X
Added a define for SEEK_SET.  Some people on the net didn't have this
in their <stdio.h>
X
November 23, 1990
X
I tried using GhostScript instead of DPStest and ran into a bug with
save/restore.  I submitted a bug report to Peter Deutsch.
Added GhostScript and NeWS command lines in the untype1 shell script.
Just comment out DPStest and uncomment out your favorite PostScript
interpreter.  DPStest is much more useful here than dxpsview.
X
November 25, 1990
X
There are often two font programs in a Type 1 file: one suitable for a
high-resolution typesetter and a simpler faster one for a LaserWriter.
I added a dtransform routine to fool the font program into thinking that
it is running on a high-resolution device.  This can be commented out
if the low-resolution version is needed.
X
December 4, 1990
X
The differing control points problem was overcome by rounding before
converting to integer in untype1_trailer.ps.  GhostScript and PostScript
now generate the same results except for hash ordering and trailing moveto.
The untype1 shell script was modified to be position independent.
You can now run it from a directory other than the current directory.
seac still doesn't work completely correctly.  It is an Adobe docubug.
The hsbw IS used more than once.  In fact with a seac font, it is used
3 times.  I gave up trying to get Adobe to explain it.
X
December 28, 1990
X
The Copyright notice is retained with the decrypted font.  There is a
save/restore pair in the font dictionary loop in untype1_trailer.ps.
This should correct the LaserWriter VMErrors.
X
January 16, 1991
X
Added the "12 15" testadd opcode definition that Peter Deutsch mentioned
in 2.1 GhostScript.  It doesn't seem to work.
X
April 30, 1991
X
For the most part untype1 is unimportant with the new releases of the
Adobe PostScript interpreters.  Display PostScript release 1006.9 uses
unprotected versions of the built-in fonts.  You can't get at the high
resolution versions from a low-resolution interpreter but it is a LOT
easier to work with.
SHAR_EOF
chmod 0644 README ||
echo 'restore of README failed'
Wc_c="`wc -c < 'README'`"
test 9436 -eq "$Wc_c" ||
	echo 'README: original size 9436, current size' "$Wc_c"
fi
# ============= chars.c ==============
if test -f 'chars.c' -a X"$1" != X"-c"; then
	echo 'x - skipping chars.c (File already exists)'
else
echo 'x - extracting chars.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'chars.c' &&
/*
X * chars.c -- decrypt an Adobe font file of encrypted CharStrings
X *
X * Chris B. Sears
X */
#include <stdio.h>
#include <strings.h>
X
#define TRUE			1
#define FALSE			0
X
#ifndef SEEK_SET
#define SEEK_SET		0		/* Some <stdio.h> files don't have this */
#endif
X
int lenIV = 4;					/* the default CharString salt length is 4 */
X
typedef struct {
X	char *command;
X	int value;
} Command;
X
Command commands[] = {
X	{ "notdefined_c0",	0 }, { "hstem",				1 },
X	{ "notdefined_c2",	2 }, { "vstem",				3 },
X	{ "vmoveto",		4 }, { "chars_rlineto",		5 },
X	{ "hlineto",		6 }, { "vlineto",			7 },
X	{ "rrcurveto",		8 }, { "chars_closepath",	9 },
X	{ "callsubr",		10 }, { "return",			11 },
X	{ "escape",			12 }, { "hsbw",				13 },
X	{ "endchar",		14 }, { "notdefined_c16",	15 },
X	{ "notdefined_c16",	16 }, { "notdefined_c17",	17 },
X	{ "notdefined_c18",	18 }, { "notdefined_c19",	19 },
X	{ "notdefined_c20",	20 }, { "chars_rmoveto",	21 },
X	{ "hmoveto",		22 }, { "notdefined_c23",	23 },
X	{ "notdefined_c24",	24 }, { "notdefined_c25",	25 },
X	{ "notdefined_c26",	26 }, { "notdefined_c27",	27 },
X	{ "notdefined_c28",	28 }, { "notdefined_c29",	29 },
X	{ "vhcurveto",		30 }, { "hvcurveto",		31 }
};
X
Command escapes[] = {
X	{ "dotsection",		0 }, { "vstem3",			1 },
X	{ "hstem3",			2 }, { "notdefined_e3",		3 },
X	{ "notdefined_e4",	4 }, { "notdefined_e5",		5 },
X	{ "seac",			6 }, { "sbw",				7 },
X	{ "notdefined_e8",	8 }, { "notdefined_e9",		9 },
X	{ "notdefined_e10",	10 }, { "notdefined_e11",	11 },
X	{ "chars_div",		12 }, { "notdefined_e13",	13 },
X	{ "notdefined_e14",	14 }, { "testadd",			15 },
X	{ "callothersubr",	16 }, { "chars_pop",		17 },
X	{ "notdefined_e18",	18 }, { "notdefined_e19",	19 },
X	{ "notdefined_e20",	20 }, { "notdefined_e21",	21 },
X	{ "notdefined_e22",	22 }, { "notdefined_e23",	23 },
X	{ "notdefined_e24",	24 }, { "notdefined_e25",	25 },
X	{ "notdefined_e26",	26 }, { "notdefined_e27",	27 },
X	{ "notdefined_e28",	28 }, { "notdefined_e29",	29 },
X	{ "notdefined_e30",	30 }, { "notdefined_e31",	31 },
X	{ "notdefined_e32",	32 }, { "setcurrentpoint",	33 }
};
X
#define MAX_ESCAPE		33
X
#define CR				4330
#define CC1				52845
#define CC2				22719
X
unsigned short int cr, cc1, cc2;
X
unsigned char
DeCrypt(cipher)
X	unsigned char cipher;
{
X	unsigned char plain;
X
X	plain = (cipher ^ (cr >> 8));
X	cr = (cipher + cr) * cc1 + cc2;
X
X	return plain;
}
X
/*
X * This is necessary because some C libraries aren't ANSI C compliant yet.
X */
char *
StrStr(string, match)
X	char *string, *match;
{
X	int i, length;
X
X	length = strlen(match);
X
X	for (i = strlen(string) - length; i >= 0; i--, string++)
X		if (!strncmp(match, string, length))
X			return string;
X
X	return NULL;
}
X
void
main(argc, argv)
X	int argc;
X	char **argv;
{
X	FILE *in, *out;
X	unsigned char in_buff[BUFSIZ], byte, *rd_pos, *count_pos;
X	int line_pos, i, count;
X	long value;
X
X	if (argc != 3) {
X		fprintf(stderr, "Usage: %s input output\n", argv[0]);
X		exit(0);
X	}
X
X	if ((in = fopen(argv[1], "r")) == NULL) {
X		fprintf(stderr, "%s: can't open %s\n", argv[0], argv[1]);
X		exit(0);
X	}
X
X	if ((out = fopen(argv[2], "w")) == NULL) {
X		fprintf(stderr, "%s: can't open %s\n", argv[0], argv[2]);
X		exit(0);
X	}
X
X	setbuf(out, NULL);
X
X	/*
X	 * TODO: rewrite this so as not to use a seek and to use stdin.
X	 */
X	for (;;) {
X		line_pos = ftell(in);
X
X		if (fgets((char *) in_buff, BUFSIZ, in) == NULL)
X			break;
X
X		if (strncmp("/lenIV", (char *) in_buff, 6) == 0)
X			lenIV = atoi(in_buff + 7);
X
X		if ((rd_pos = (unsigned char *) StrStr(in_buff, " RD ")) == NULL) {
X			if ((rd_pos = (unsigned char *) StrStr(in_buff, " -| ")) == NULL) {
X				fputs((char *) in_buff, out);
X				continue;
X			}
X		}
X
X		/*
X		 * We found an encrypted CharString.
X		 * Back up and determine the number of encrypted characters.
X		 * These have the form: dup 105 9 RD 9bytesofdata noaccess put
X		 */
X		for (count_pos = rd_pos - 1;
X			(count_pos >= in_buff) && (*count_pos != ' ');
X			count_pos--)
X				;
X
X		if (*count_pos == ' ')	/* This can be at the beginning of a line */
X			count_pos++;
X
X		/*
X		 * Write out the beginning of the string without the RD stuff.
X		 */
X		fwrite(in_buff, count_pos - in_buff, 1, out);
X		fprintf(out, "{");
X
X		count = atoi(count_pos);
X
X		/*
X		 * Seek to and read the binary data.
X		 */
X		fseek(in, line_pos + (rd_pos - in_buff) + 4, SEEK_SET);
X		fread(in_buff, BUFSIZ, 1, in);
X
X		/*
X		 * We must restart the decryption machinery for each CharString.
X		 */
X		cr = CR;
X		cc1 = CC1;
X		cc2 = CC2;
X
X		/*
X		 * Skip over the salt.
X		 */
X		for (i = 0; i < lenIV; i++)
X			byte = DeCrypt(in_buff[i]);
X
X		/*
X		 * Translate the buffer.
X		 */
X		for (; i < count;) {
X			byte = DeCrypt(in_buff[i++]);
X			if (byte == 11) {			/* return */
X				fprintf(out, " %s", commands[byte].command);
X				break;
X			} else if (byte == 12) {	/* escape */
X				byte = DeCrypt(in_buff[i++]);
X				if (byte > MAX_ESCAPE)
X					fprintf(out, " not_defined_e%d", byte);
X				else
X					fprintf(out, " %s", escapes[byte].command);
X				continue;
X			} else if (byte < 32)
X				fprintf(out, " %s", commands[byte].command);
X
X			if (byte >= 32) {
X				if (byte <= 246)
X					fprintf(out, " %d", byte - 139);
X				else if ((byte >= 247) && (byte <= 250))
X					fprintf(out, " %d",
X						(byte - 247) * 256 + DeCrypt(in_buff[i++]) + 108);
X				else if ((byte >= 251) && (byte <= 254))
X					fprintf(out, " %d",
X						-(byte - 251) * 256 - DeCrypt(in_buff[i++]) - 108);
X				else if (byte == 255) {
X					value = DeCrypt(in_buff[i++]);
X					value <<= 8;
X					value += DeCrypt(in_buff[i++]);
X					value <<= 8;
X					value += DeCrypt(in_buff[i++]);
X					value <<= 8;
X					value += DeCrypt(in_buff[i++]);
X					fprintf(out, " %d", value);
X				}
X			}
X		}
X
X		fprintf(out, " }");
X
X		/*
X		 * Seek just past the CharString bytes and continue.
X		 */
X		fseek(in, line_pos + (rd_pos - in_buff) + 4 + i, SEEK_SET);
X	}
X
X	fclose(in);
X	fclose(out);
X
X	exit(0);
}
SHAR_EOF
chmod 0644 chars.c ||
echo 'restore of chars.c failed'
Wc_c="`wc -c < 'chars.c'`"
test 5787 -eq "$Wc_c" ||
	echo 'chars.c: original size 5787, current size' "$Wc_c"
fi
# ============= eexec.c ==============
if test -f 'eexec.c' -a X"$1" != X"-c"; then
	echo 'x - skipping eexec.c (File already exists)'
else
echo 'x - extracting eexec.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'eexec.c' &&
/*
X * eexec.c -- decrypt an Adobe font file encrypted for eexec
X *
X * Chris B. Sears
X */
#include <stdio.h>
#include <strings.h>
X
#define TRUE				1
#define FALSE				0
X
#define EEXEC_SKIP_BYTES	4
X
unsigned short int er =		55665;
unsigned short int ec1 =	52845;
unsigned short int ec2 =	22719;
X
unsigned char
DeCrypt(ch1, ch2)
X	unsigned char ch1, ch2;
{
X	unsigned char plain, cipher;
X
X	/*
X	 * Decode hex.
X	 */
X	if ('A' <= ch1 && ch1 <= 'F')
X		ch1 -= 'A' - 10;
X	else if ('a' <= ch1 && ch1 <= 'f')
X		ch1 -= 'a' - 10;
X	else
X		ch1 -= '0';
X
X	if ('A' <= ch2 && ch2 <= 'F')
X		ch2 -= 'A' - 10;
X	else if ('a' <= ch2 && ch2 <= 'f')
X		ch2 -= 'a' - 10;
X	else
X		ch2 -= '0';
X
X	/*
X	 * Decode cipher.
X	 */
X	cipher = ch1 * 16 + ch2;
X
X	plain = (cipher ^ (er >> 8));
X	er = (cipher + er) * ec1 + ec2;
X
X	return plain;
}
X
void
main(argc, argv)
X	int argc;
X	char **argv;
{
X	FILE *in;
X	char in_buff[BUFSIZ], out_buff[BUFSIZ];
X	int i, o, in_size;
X	int skip_salt = TRUE;
X
X	if (argc != 2) {
X		fprintf(stderr, "Usage: %s input\n", argv[0]);
X		exit(0);
X	}
X
X	if ((in = fopen(argv[1], "r")) == NULL) {
X		fprintf(stderr, "%s: can't open %s\n", argv[0], argv[1]);
X		exit(0);
X	}
X
X	/*
X	 * Just copy to output until we see an eexec.
X	 */
X	while (fgets(in_buff, BUFSIZ, in) != NULL) {
X		if (strcmp(in_buff, "currentfile eexec\n") == 0)
X			break;
X		fprintf(stdout, "%s", in_buff);
X	}
X
X	for (;;) {
X		if (fgets(in_buff, BUFSIZ, in) == NULL)
X			break;
X		in_size = strlen(in_buff) - 1;
X
X		/*
X		 * Decrypt a line of hex.
X		 */
X		for (i = o = 0; i < in_size; i += 2)
X			out_buff[o++] = DeCrypt(in_buff[i], in_buff[i + 1]);
X
X		/*
X		 * Skip the salt if this is the first cypher line.
X		 */
X		if (skip_salt) {
X			fwrite(out_buff + EEXEC_SKIP_BYTES,
X				o - EEXEC_SKIP_BYTES, 1, stdout);
X			skip_salt = FALSE;
X		} else
X			fwrite(out_buff, o, 1, stdout);
X	}
X
X	fclose(in);
X
X	exit(0);
}
SHAR_EOF
chmod 0666 eexec.c ||
echo 'restore of eexec.c failed'
Wc_c="`wc -c < 'eexec.c'`"
test 1833 -eq "$Wc_c" ||
	echo 'eexec.c: original size 1833, current size' "$Wc_c"
fi
# ============= untype1_header.ps ==============
if test -f 'untype1_header.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping untype1_header.ps (File already exists)'
else
echo 'x - extracting untype1_header.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'untype1_header.ps' &&
%!
% untype1_header.ps
%
% Chris B. Sears
%
% After interpreting a decrypted Adobe font program there are four dictionaries
%
%		font (implicit)
%		FontInfo
%		Private
%		CharStrings
%
% The strategy is to redefine certain operators, interpret the font and dump
% the resulting dictionaries while filtering out font hint operators.
% The resulting paths are converted into very simple PostScript using
% the pathforall operator.
%
X
/readonly { } bind def
/executeonly { } bind def
/noaccess { } bind def
/definefont { } bind def
X
%
% This is a hack to make the font code think that it is running
% on a high resolution interpreter.  hires will evaluate to true.
% dtransform is used to determine whether or not hires it true or false.
% It is also used in the othersubrs hint routines.  These are bypassed below.
% If this is not desired the dtransform routine below should be commented out.
%
/dtransform {
X	dup type (arraytype) eq {
X		pop
X	} if
X	[ 2540 72 div 0.0 0.0 -2540 72 div 0.0 0.0 ]
X	//dtransform
} bind def
X
/clearStack { cleartomark mark } bind def
X
%
% commands for starting and finishing
%
/endchar { clearStack } bind def
X
%
% Contrary to the Black Book guidelines, there are three hsbw commands
% associated with a seac command.  Ignore the hsbw before the seac command.
% It is the same as the hwbw for the base character.  Use asb to preemptively
% remove the effect of the accent's hsbw.
%
/seac {					% Standard Encoding Accented Character
X	/achar exch def		% accent character
X	/bchar exch def		% base character
X	/ady exch def		% accent origin y
X	/adx exch def		% accent origin x
X	/asb exch def		% accent sidebearing
X
X	/xOrigin 0 def /yOrigin 0 def	% ignore the hsbw before the seac
X	newpath 0 0 moveto
X
X	Encoding bchar get load exec	% exec the base character
X
X	/base_width charWidth def		% width of the base character
X
X	/xOrigin adx xOrigin add asb sub def	% the accent origin is relative
X	/yOrigin ady yOrigin add def			% to the base character origin
X
X	Encoding achar get load exec	% exec the accent character
X
X	/charWidth base_width def		% width of the base character
} bind def
X
/hsbw {
X	/charWidth exch def
X	/xOrigin exch xOrigin add def
X
X	xOrigin yOrigin moveto clearStack
} bind def
X
%
% What characters use sbw?  For now just ignore wy.
%
/sbw {
X	pop
X	/charWidth exch def
X	/yOrigin exch yOrigin add def
X	/xOrigin exch xOrigin add def
X	xOrigin yOrigin moveto clearStack
} bind def
X
%
% This opcode was not documented by Adobe in the Black Book.
%
/testadd { gt { add } { pop } ifelse } bind def
X
%
% path construction commands
%
% convert the operators and operands to rmoveto, rlineto and rcurveto.
% chars_closepath has different semantics from PostScript closepath.
%
/chars_closepath { currentpoint closepath moveto clearStack } bind def
/hlineto { 0 rlineto clearStack } bind def
/hmoveto { 0 rmoveto clearStack } bind def
/chars_rlineto { rlineto clearStack } bind def
/chars_rmoveto { rmoveto clearStack } bind def
/vlineto { 0 exch rlineto clearStack } bind def
/vmoveto { 0 exch rmoveto clearStack } bind def
X
%
% Convert the various Type 1 curves into Type 1 rrcurveto's
%
/hvcurveto {
X	/dy3 exch def /dy2 exch def /dx2 exch def /dx1 exch def
X	dx1 0 dx2 dy2 0 dy3 rrcurveto
} bind def
X
/vhcurveto {
X	/dx3 exch def /dy2 exch def /dx2 exch def /dy1 exch def
X	0 dy1 dx2 dy2 dx3 0 rrcurveto
} bind def
X
%
% Convert Type 1 rrcurveto's into PostScript rcurveto's
%
/rrcurveto {
X	/dy3 exch def /dx3 exch def
X	/dy2 exch def /dx2 exch def
X	/dy1 exch def /dx1 exch def
X	dx1 dy1
X	dx1 dx2 add dy1 dy2 add
X	dx1 dx2 dx3 add add dy1 dy2 dy3 add add
X	rcurveto clearStack
} bind def
X
%
% ignore hint commands
%
/dotsection { clearStack } bind def
/hstem { clearStack } bind def
/hstem3 { clearStack } bind def
/vstem { clearStack } bind def
/vstem3 { clearStack } bind def
X
%
% Arithmetic command
%
/chars_div { div } bind def
X
%
% Subroutine commands
% All OtherSubr routines are hint related and are ignored.
% They leave their arguments on the stack unchanged.
%
/callothersubr { } bind def
X
%
% For 0, 1, 2 the stack contents are left unchanged.
% For 3, the trailing pop will push a 3 on the stack.
% See p. 95 of the Black Book.
%
/callsubr {
X	/i exch def
X	i 0 eq {
X		pop pop pop		% unused Flex height control parameter and end points
X		/y5 exch def /x5 exch def
X		/y4 exch def /x4 exch def
X		/y3 exch def /x3 exch def
X		/y2 exch def /x2 exch def
X		/y1 exch def /x1 exch def
X		/y0 exch def /x0 exch def
X		/yRef exch def /xRef exch def
X
X		x0 xRef add y0 yRef add x1 y1 x2 y2 rrcurveto
X		x3 y3 x4 y4 x5 y5 rrcurveto
X
%
% The Flex can be replaced by a lineto.
%
X
X		/chars_rmoveto { rmoveto clearStack } def
X	} if
X	i 1 eq {
X		/chars_rmoveto { } def
X	} if
X	i 2 eq { } if		% leave the arguments on the stack
X	i 3 eq { } if
X	i 3 gt {			% normal subroutines
X		Subrs i get exec
X	} if
} bind def
X
/return { } bind def
X
/chars_pop {			% transfers from PS stack to BuildChar stack
X	3					% see Black Book, page 70
} bind def				% this may need to be changed with new Type 1 versions
X
%
% setcurrentpoint shouldn't appear in a charstring program.
% It should only appear in unused subroutines.
%
SHAR_EOF
chmod 0644 untype1_header.ps ||
echo 'restore of untype1_header.ps failed'
Wc_c="`wc -c < 'untype1_header.ps'`"
test 5109 -eq "$Wc_c" ||
	echo 'untype1_header.ps: original size 5109, current size' "$Wc_c"
fi
# ============= untype1_trailer.ps ==============
if test -f 'untype1_trailer.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping untype1_trailer.ps (File already exists)'
else
echo 'x - extracting untype1_trailer.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'untype1_trailer.ps' &&
%
% untype1_trailer.ps
%
%
% Chris B. Sears
%
X
/printString 20 string def
X
%
% All of the numbers being passed in are real equivalents of integers.
% Convert them back into ints before printing so that print doesn't
% append a ".0"
%
/printNumbers {
X	/ii exch def	% careful about using /i since it is a defined proc
X	ii 1 sub -1 0 { index round cvi printString cvs print ( ) print } for
X	ii { pop } repeat
} bind def
X
%
% Traverse the dictionaries and arrays.
%
begin
Private begin
FontInfo begin
CharStrings begin
100 dict begin
X
100 100 moveto
X
/Notice where {
X	pop
X	(/Notice \() print
X	Notice print
X	(\) readonly def\n) print
} {
X	(/Notice \(NoNotice\) readonly def\n) print
} ifelse
X
/Copyright where {
X	pop
X	(/Copyright \() print
X	Copyright print
X	(\) readonly def\n) print
} {
X	(/Copyright \(NoCopyright\) readonly def\n) print
} ifelse
X
/FullName where {
X	pop
X	(/FullName \() print
X	FullName print
X	(\) readonly def\n) print
} {
X	(/FullName \(NoName\) readonly def\n) print
} ifelse
X
10 setflat
X
CharStrings { % name procedure
X	/proc exch def
X	/name exch def
X	save
X		/xOrigin 0 def
X		/yOrigin 0 def
X		(/) print name printString cvs print ( { ) print
X		mark gsave newpath proc cleartomark
%			flattenpath		% You might want to experiment with setflat
X			(/charWidth ) print charWidth 1 printNumbers (def ) print
X			{ 2 printNumbers (moveto ) print }	% If the lines are too long
X			{ 2 printNumbers (lineto ) print }	% you might want to change
X			{ 6 printNumbers (curveto ) print }	% the trailing spaces to
X			{ (closepath ) print } pathforall	% trailing newlines: \n
X		grestore
X		(} def\n) print
X	restore
X	0 40 rmoveto
} bind forall
SHAR_EOF
chmod 0644 untype1_trailer.ps ||
echo 'restore of untype1_trailer.ps failed'
Wc_c="`wc -c < 'untype1_trailer.ps'`"
test 1639 -eq "$Wc_c" ||
	echo 'untype1_trailer.ps: original size 1639, current size' "$Wc_c"
fi
# ============= untype1 ==============
if test -f 'untype1' -a X"$1" != X"-c"; then
	echo 'x - skipping untype1 (File already exists)'
else
echo 'x - extracting untype1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'untype1' &&
#!/bin/sh
#
# untype1 -- transform an Adobe Type 1 font file encrypted
#            with eexec and CharStrings into raw PostScript
#
X
PROGRAM=`basename $0`
DIRECTORY=`dirname $0`
TMP1=/tmp/$$.tr1
TMP2=/tmp/$$.tr2
TMP3=/tmp/$$.tr3
TMP4=/tmp/$$.tr4
X
trap 'rm -f /tmp/$$.tr?; exit 0' 0 1 2 15
X
case $# in
2) ;;
*) echo "Usage: $PROGRAM \"Adobe Type 1 font file\" \"PostScript output file\""
X   exit 1;;
esac
X
$DIRECTORY/eexec $1 > $TMP1
$DIRECTORY/chars $TMP1 $TMP2
sed -e '/definefont/,$d' $TMP2 > $TMP3
cat $DIRECTORY/untype1_header.ps $TMP3 $DIRECTORY/untype1_trailer.ps > $TMP4
X
echo flush quit >> $TMP4
gs -DNODISPLAY $TMP4 > $2      # GhostScript
X
#nsh $TMP4 > $2                 # NeWS
X
#DPStest > $2 <<end-of-here     # Display PostScript
#$TMP4
#end-of-here
SHAR_EOF
chmod 0755 untype1 ||
echo 'restore of untype1 failed'
Wc_c="`wc -c < 'untype1'`"
test 764 -eq "$Wc_c" ||
	echo 'untype1: original size 764, current size' "$Wc_c"
fi
# ============= un-adobe.hqx ==============
if test -f 'un-adobe.hqx' -a X"$1" != X"-c"; then
	echo 'x - skipping un-adobe.hqx (File already exists)'
else
echo 'x - extracting un-adobe.hqx (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'un-adobe.hqx' &&
Date: Tue, 13 Mar 90 23:59:57 -0800
XFrom: C43MRP%AVIARY.gm@hac2arpa.hac.com
Subject: unAdobe.hqx
X
unAdobe is an application that converts an Adobe type 1 font into printable
ASCII characters that can be edited into a postscript document.  Written by
Jerry Keough and Ted Ede of the Mitre Corp.
X
Enjoy!
X
Mark Probert
Delco Electronics
X
(This file must be converted with BinHex 4.0)
X
:#h9Z3@4[BQ8ZFfPd!&0*9#&6593K!3!!!"Ld!!!!!2rl8dP8)3!"!!!BY(*-BA8
"!!!!!!!!!!)!"h9Z3@4[BQ8Y6'pRT3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%&38%a+5e4&)3#IZ*E*RlL@c!!!(Hi
!!!!!!!!B,J!!!!#eC`!!!!!!!!!!)T!!!!!%#!LJ!j+!(!i'0%83`)i"p`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KdAQb3`"!6ANKZ53!&Ub4N3*'f!
$4b30R"-aJN5fL"a3$'4J0r!MSF!%P-)"X$&*Mb`8aB"J%"##3J!!$+%2!J%")!m
)!JI!M$KS#$b"J&-898"3()T&83JdP9C'%,5!6``)CN!T#TbLf,T@SGJL#!,!"KJ
#A[J2FN)'B![[iaF#J!`!#4D&$4!%8[!8+L"+d"#5Bd$B!*M!12S"h[JFJ8&c"!!
DdHj)Vp`i1B3M"qJ"$3&4I`!!:
SHAR_EOF
chmod 0644 un-adobe.hqx ||
echo 'restore of un-adobe.hqx failed'
Wc_c="`wc -c < 'un-adobe.hqx'`"
test 9054 -eq "$Wc_c" ||
	echo 'un-adobe.hqx: original size 9054, current size' "$Wc_c"
fi
# ============= view_header.ps ==============
if test -f 'view_header.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping view_header.ps (File already exists)'
else
echo 'x - extracting view_header.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'view_header.ps' &&
%!
% view_header.ps
%
% Chris B. Sears
%
X
300 dict dup /font_dict exch def
begin
SHAR_EOF
chmod 0644 view_header.ps ||
echo 'restore of view_header.ps failed'
Wc_c="`wc -c < 'view_header.ps'`"
test 81 -eq "$Wc_c" ||
	echo 'view_header.ps: original size 81, current size' "$Wc_c"
fi
# ============= view_trailer.ps ==============
if test -f 'view_trailer.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping view_trailer.ps (File already exists)'
else
echo 'x - extracting view_trailer.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'view_trailer.ps' &&
%
% view_trailer.ps
%
% Chris B. Sears
%
X
end
X
%
% The display order is strange because of the hashing of dictionary entries.
%
/printString 30 string def
/ii 0 def	% careful: the name /i is used as a character name
/Helvetica findfont 30 scalefont setfont
100 100 translate
X
font_dict {	% name procedure
X	/proc exch def
X	/name exch def
X	name /.notdef ne name /Notice ne and
X	name /Copyright ne name /FullName ne and and {
X		gsave
X			gsave
X			erasepage
X			0.3 0.3 scale
X			proc stroke
X			gsave
X				0 0 moveto 0 1000 rlineto	% why doesn't Adobe use 1024?
X				1000 0 rlineto 0 -1000 rlineto closepath stroke
X				charWidth 2 div 0 moveto 0 1000 rlineto closepath stroke
X				gsave
X					10 setlinewidth 0 -5 moveto charWidth 0 rlineto stroke
X				grestore
X			grestore
X			grestore
X			name printString cvs gsave 0 -50 moveto show grestore
X			gsave -50 -50 moveto ii printString cvs show grestore
X			/ii ii 1 add def
X			usertime 800 add
X			{ dup usertime lt { pop exit } if } loop
X		grestore
X	} if
} bind forall
X
200 -50 moveto (Done) show
SHAR_EOF
chmod 0644 view_trailer.ps ||
echo 'restore of view_trailer.ps failed'
Wc_c="`wc -c < 'view_trailer.ps'`"
test 1031 -eq "$Wc_c" ||
	echo 'view_trailer.ps: original size 1031, current size' "$Wc_c"
fi
# ============= reenc.ps ==============
if test -f 'reenc.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping reenc.ps (File already exists)'
else
echo 'x - extracting reenc.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'reenc.ps' &&
%
% reenc.ps - useful for looking at the seac problem
%
% Chris B. Sears
%
X
/reencsmalldict 12 dict def
/ReEncodeSmall {
X	reencsmalldict begin
X	/newcodesandnames exch def
X	/newfontname exch def
X	/basefontname exch def
X
X	/basefontdict basefontname findfont def
X	/newfont basefontdict maxlength dict def
X
X	basefontdict {
X		exch dup /FID ne {
X			dup /Encoding eq {
X				exch dup length array copy
X				newfont 3 1 roll put
X			} {
X				exch newfont 3 1 roll put
X			} ifelse
X		} {
X			pop pop
X		} ifelse
X	} forall
X
X	newfont /FontName newfontname put
X	newcodesandnames aload pop
X	newcodesandnames length 2 idiv {
X		newfont /Encoding get 3 1 roll put
X	} repeat
X
X	newfontname newfont definefont pop
X	end
} def
X
/scandvec [
X	8#300 /Oacute
X	8#311 /Adieresis
X	8#321 /oacute
X	8#322 /Ograve
X	8#323 /Scaron
X	8#324 /ograve
X	8#325 /scaron
X	8#330 /Edieresis
X	8#331 /adieresis
X	8#332 /edieresis
X	8#333 /Odieresis
X	8#334 /odieresis
X	8#340 /Aacute
X	8#342 /Aring
X	8#344 /Zcaron
X	8#347 /Eacute
X	8#360 /aacute
X	8#362 /aring
X	8#364 /zcaron
X	8#367 /eacute
] def
X
50 50 translate
X
/Palatino-Roman /Palatino-Roman-Scand scandvec ReEncodeSmall
/Palatino-Roman-Scand findfont 100 scalefont setfont
X
(\300) 0 0 moveto show
(\311) 100 0 moveto show
(\321) 200 0 moveto show
(\322) 300 0 moveto show
(\323) 400 0 moveto show
(\325) 0 100 moveto show
(\330) 100 100 moveto show
(\331) 200 100 moveto show
(\332) 300 100 moveto show
(\333) 400 100 moveto show
(\340) 0 200 moveto show
(\342) 100 200 moveto show
(\344) 200 200 moveto show
(\360) 300 200 moveto show
(\362) 400 200 moveto show
(\367) 0 300 moveto show
(\324) 100 300 moveto show
(\334) 200 300 moveto show
(\364) 300 300 moveto show
SHAR_EOF
chmod 0644 reenc.ps ||
echo 'restore of reenc.ps failed'
Wc_c="`wc -c < 'reenc.ps'`"
test 1661 -eq "$Wc_c" ||
	echo 'reenc.ps: original size 1661, current size' "$Wc_c"
fi
# ============= patchlevel.h ==============
if test -f 'patchlevel.h' -a X"$1" != X"-c"; then
	echo 'x - skipping patchlevel.h (File already exists)'
else
echo 'x - extracting patchlevel.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patchlevel.h' &&
#define PATCHLEVEL 0
SHAR_EOF
chmod 0644 patchlevel.h ||
echo 'restore of patchlevel.h failed'
Wc_c="`wc -c < 'patchlevel.h'`"
test 21 -eq "$Wc_c" ||
	echo 'patchlevel.h: original size 21, current size' "$Wc_c"
fi
exit 0

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.