🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #4470

Re: PageMaker4 PostScript problems

#4470
From: Glenn Reid
Date: Wed, 16 Jan 1991 05:12
50 lines
2239 bytes
In article <11057@darkstar.ucsc.edu> zoetrop@ucscb.ucsc.edu (Devan zoetrope MacFarlane) writes:
>Your pagemaker is defining the missing characters and calling for them with
>8-bit codes, which is against all of the rules (well some of them).  Unix
>machines are 7-bit devices, which caused the top bit to be lopped off and
>the character printed from the lower half of the character set.  I solved
>it here by editing all of the 8-bit characters and replacing them with the
>correct PostScript octal call (\xxx).

>Any help you can offer me on this problem is greatly appreciated (Does anyone
>have any *NIX utilities to do the change automatically? Or a util. for the Mac
>to do the change?).

Here is a very simple C program that will find characters with the eighth
bit set and replace it with the \xxx notation.  Note that the PostScript
language convention recognizes the \xxx only within string bodies, but it
shouldn't hurt to replace all the 8-bit characters (unless there are 8-bit
characters used in PostScript names somewhere in the code, which I very
much doubt unless it came from a non-English-language system).

--- cut here ----

#include <stdio.h>

/* reads from stdin, writes to stdout, replaces 8-bit characters with
   7-bit equivalent expression using PostScript \xxx standard notation */

main ()
{
    int ch;
    short cont;

    cont = 1;
    while ( cont ) {
	ch=getchar();
	cont = (ch != EOF);
	if ( cont ) {
	    if ( ch > 127 ) {
		printf ( "\\%3o", ch );
		fprintf ( stderr, "\\%3o\n", ch );
	    } else {
		putchar ( ch );
	    }
	}
    }
}

-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)
Technical Details
Message-ID: <394@heaven.woodside.ca.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!adobe!heaven!glenn
References: <11057@darkstar.ucsc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!adobe!heaven!glenn
From: glenn@heaven.woodside.ca.us (Glenn Reid)
Newsgroups: comp.lang.postscript
Subject: Re: PageMaker4 PostScript problems
Message-ID: <394@heaven.woodside.ca.us>
Date: 16 Jan 91 05:12:27 GMT
References: <11057@darkstar.ucsc.edu>
Reply-To: glenn@heaven.woodside.ca.us (Glenn Reid)
Organization: RightBrain Software, Woodside, CA
Lines: 50