xref: /plan9-contrib/sys/src/cmd/postscript/README (revision 219b2ee8daee37f4aad58d63f21287faa8e4ffdc)
1*219b2ee8SDavid du ColombierStuff appears to work, but it's obviously not well tested. I fully
2*219b2ee8SDavid du Colombierexpect several iterations before things are correct!! Make sure you
3*219b2ee8SDavid du Colombiercan back this out quickly.
4*219b2ee8SDavid du Colombier
5*219b2ee8SDavid du ColombierThis code supports UTF encoding. Directory dpost.utf is a version that
6*219b2ee8SDavid du Colombierreads UTF encoded files. Directory dpost is DWB 3.3 source and should be
7*219b2ee8SDavid du Colombierclose to what you're currently using. Main source code changes were in
8*219b2ee8SDavid du Colombierdpost.utf (files font.h, font.c, and dpost.c). Select either dpost or
9*219b2ee8SDavid du Colombierdpost.utf in TARGETS in postscript.mk. Both build and install a program
10*219b2ee8SDavid du Colombiercalled dpost!!
11*219b2ee8SDavid du Colombier
12*219b2ee8SDavid du Colombierdpost.utf is more general and includes code that lets it read either
13*219b2ee8SDavid du Colombierformat. Only catch is troff must tell it (with x E UTF) that the file
14*219b2ee8SDavid du Colombieris UTF and troff currently doesn't output encoding info, so you're
15*219b2ee8SDavid du Colombierstuck with two post-processors!
16*219b2ee8SDavid du Colombier
17*219b2ee8SDavid du ColombierAdded common/rune.h and common/rune.c so code can be compiled elsewere.
18*219b2ee8SDavid du ColombierBoth files are only used by dpost. Remove RUNELIB in commmon/rune.h if
19*219b2ee8SDavid du Colombierfullrune(), chartorune(), and runetochar() are available on your system.
20*219b2ee8SDavid du ColombierYou will also need to set READING in common/gen.h. It controls how dpost
21*219b2ee8SDavid du Colombier(from dpost.utf) reads troff output. It should be UTFENCODING on Plan 9
22*219b2ee8SDavid du Colombierand ONEBYTE elsewhere. If troff includes encoding hint (x E UTF) then
23*219b2ee8SDavid du ColombierREADING selects the default which sould be ONEBYTE.
24*219b2ee8SDavid du Colombier
25*219b2ee8SDavid du ColombierLeave WRITING (in common/gen.h) set to ONEBYTE. It only controls dpost
26*219b2ee8SDavid du Colombieroutput and dpost (right now) does not work 100% with UTF.enc. Fix should
27*219b2ee8SDavid du Colombierbe easy, but I don't have time now.
28*219b2ee8SDavid du Colombier
29*219b2ee8SDavid du ColombierOther translators passed bytes through so only needed slightly modified
30*219b2ee8SDavid du Colombierproglogues and a new encoding scheme (psencoding/UTF.enc). It works for
31*219b2ee8SDavid du ColombierLatin1, but still needs a bit more attention. Prologue changes were easy
32*219b2ee8SDavid du Colombierand only involved adding lines like,
33*219b2ee8SDavid du Colombier
34*219b2ee8SDavid du Colombier	/show {show} bind def
35*219b2ee8SDavid du Colombier	/stringwidth {stringwidth} bind def
36*219b2ee8SDavid du Colombier
37*219b2ee8SDavid du ColombierGuarantees text procedures used in prologues aren't operators and can be
38*219b2ee8SDavid du Colombiersuccessfully redefined in UTF.enc. Unbinding means a small but probably
39*219b2ee8SDavid du Colombiernot noticeable speed penalty. You may not want to include those changes
40*219b2ee8SDavid du Colombieron other system.
41*219b2ee8SDavid du Colombier
42*219b2ee8SDavid du Colombier-------------
43*219b2ee8SDavid du ColombierMajor Changes
44*219b2ee8SDavid du Colombier-------------
45*219b2ee8SDavid du Colombier
46*219b2ee8SDavid du ColombierSee the VERSION file.
47*219b2ee8SDavid du Colombier
48*219b2ee8SDavid du Colombier-------------------
49*219b2ee8SDavid du ColombierTuning The Makefile
50*219b2ee8SDavid du Colombier-------------------
51*219b2ee8SDavid du Colombier
52*219b2ee8SDavid du ColombierSource files, man pages, and low level makefiles can all be updated
53*219b2ee8SDavid du Colombierto reflect settings in postscript.mk in one simple step (described
54*219b2ee8SDavid du Colombierlater). In most cases you only need to edit file postscript.mk.
55*219b2ee8SDavid du Colombier
56*219b2ee8SDavid du ColombierFirst save a copy of file postscript.mk. Then adjust the following
57*219b2ee8SDavid du Colombierdefinitions in file postscript.mk:
58*219b2ee8SDavid du Colombier
59*219b2ee8SDavid du Colombier  SYSTEM    best match for your version of Unix. Current choices for
60*219b2ee8SDavid du Colombier	    SYSTEM are:
61*219b2ee8SDavid du Colombier
62*219b2ee8SDavid du Colombier			SYSV	- System V
63*219b2ee8SDavid du Colombier			V9	- Ninth Edition
64*219b2ee8SDavid du Colombier			BSD4_2	- Berkeley (eg. Sun)
65*219b2ee8SDavid du Colombier
66*219b2ee8SDavid du Colombier	    Controls conditional compilation in a few places.
67*219b2ee8SDavid du Colombier
68*219b2ee8SDavid du Colombier  GROUP	    group assigned to all installed files
69*219b2ee8SDavid du Colombier
70*219b2ee8SDavid du Colombier  OWNER	    owner of everything that's installed
71*219b2ee8SDavid du Colombier
72*219b2ee8SDavid du Colombier  BINDIR    dpost and picpack go here. All other programs go in POSTBIN.
73*219b2ee8SDavid du Colombier	    BINDIR must already exist - it will not be created during an
74*219b2ee8SDavid du Colombier	    install.
75*219b2ee8SDavid du Colombier
76*219b2ee8SDavid du Colombier  HOSTDIR   hostresident font directory for PostScript printers. Only
77*219b2ee8SDavid du Colombier	    used in the font download program.
78*219b2ee8SDavid du Colombier
79*219b2ee8SDavid du Colombier  FONTDIR   width table directory - for troff and most postprocessors
80*219b2ee8SDavid du Colombier
81*219b2ee8SDavid du Colombier  MAN1DIR   command manpages. A command and its manpage are installed
82*219b2ee8SDavid du Colombier	    together - there's no easy way to avoid it. Setting MAN1DIR
83*219b2ee8SDavid du Colombier	    to an existing temporary directory (e.g. /tmp) means an
84*219b2ee8SDavid du Colombier	    install will work but manpages won't go anywhere permanent.
85*219b2ee8SDavid du Colombier	    MAN1DIR must already exist - it will not be created during
86*219b2ee8SDavid du Colombier	    an install.
87*219b2ee8SDavid du Colombier
88*219b2ee8SDavid du Colombier  POSTBIN   where most PostScript support programs go. dpost and picpack
89*219b2ee8SDavid du Colombier	    the exceptions.
90*219b2ee8SDavid du Colombier
91*219b2ee8SDavid du Colombier  POSTLIB   prologues and miscellaneous PostScript files. Primarily for
92*219b2ee8SDavid du Colombier	    the programs that live in POSTBIN.
93*219b2ee8SDavid du Colombier
94*219b2ee8SDavid du Colombier  CFLGS	    common compiler options - used to build CFLAGS in the low
95*219b2ee8SDavid du Colombier	    level makefiles. CLFGS and LDFLGS are best set on the make
96*219b2ee8SDavid du Colombier	    command line.
97*219b2ee8SDavid du Colombier
98*219b2ee8SDavid du Colombier  LDFLGS    common link editor options - used to build LDFLAGS in the
99*219b2ee8SDavid du Colombier	    low level makefiles. LDFLGS and CFLGS are best set on the
100*219b2ee8SDavid du Colombier	    make command line.
101*219b2ee8SDavid du Colombier
102*219b2ee8SDavid du Colombier  DKHOST    set it to TRUE to compile the DKHOST Datakit support code
103*219b2ee8SDavid du Colombier	    in postio. Temporarily resets SYSTEM to SYSV if DKHOST is
104*219b2ee8SDavid du Colombier	    TRUE and SYSTEM is BSD4_2. Ignored if SYSTEM is not SYSV
105*219b2ee8SDavid du Colombier	    or BSD4_2.
106*219b2ee8SDavid du Colombier
107*219b2ee8SDavid du Colombier  DKSTREAMS enables streams based DKHOST support in postio when DKHOST
108*219b2ee8SDavid du Colombier	    is TRUE and SYSTEM is SYSV or BSD4_2. Choices are TRUE,
109*219b2ee8SDavid du Colombier	    FALSE, or a stream module name (e.g. dknetty or dkty). TRUE
110*219b2ee8SDavid du Colombier	    selects dknetty. Newer systems may expect dkty.
111*219b2ee8SDavid du Colombier
112*219b2ee8SDavid du Colombier  ROUNDPAGE must only be set to TRUE or FALSE. TRUE means PostScript
113*219b2ee8SDavid du Colombier	    translators include code that maps clipping path dimensions
114*219b2ee8SDavid du Colombier	    into known paper sizes.
115*219b2ee8SDavid du Colombier
116*219b2ee8SDavid du Colombier  TARGETS   the default list of what's built by make. Each target must
117*219b2ee8SDavid du Colombier	    be the name of a source directory. A target that names a
118*219b2ee8SDavid du Colombier	    non-existent source directory is ignored. Setting TARGETS
119*219b2ee8SDavid du Colombier	    on the make command line overrides the default list.
120*219b2ee8SDavid du Colombier
121*219b2ee8SDavid du Colombier-------------------
122*219b2ee8SDavid du ColombierUpdating The Source
123*219b2ee8SDavid du Colombier-------------------
124*219b2ee8SDavid du Colombier
125*219b2ee8SDavid du ColombierWhenever file postscript.mk changes you should update source files,
126*219b2ee8SDavid du Colombierman pages, and low level makefiles by typing,
127*219b2ee8SDavid du Colombier
128*219b2ee8SDavid du Colombier	make -f postscript.mk changes
129*219b2ee8SDavid du Colombier
130*219b2ee8SDavid du Colombier------------------------
131*219b2ee8SDavid du ColombierMore System Dependencies
132*219b2ee8SDavid du Colombier------------------------
133*219b2ee8SDavid du Colombier
134*219b2ee8SDavid du ColombierThe package has been compiled and tested on System V and Ninth Edition
135*219b2ee8SDavid du ColombierUnix Systems and on Sun workstations. Most differences are handled via
136*219b2ee8SDavid du Colombierthe SYSTEM definition in postscript.mk. Problems that remain are:
137*219b2ee8SDavid du Colombier
138*219b2ee8SDavid du Colombier  SYSV - System V
139*219b2ee8SDavid du Colombier    Use the native compiler if you're on an internal System V UTS
140*219b2ee8SDavid du Colombier    machine.
141*219b2ee8SDavid du Colombier
142*219b2ee8SDavid du Colombier  V9 - Ninth or Tenth Edition
143*219b2ee8SDavid du Colombier    chown is in /etc and chgrp no longer exists - it's been folded into
144*219b2ee8SDavid du Colombier    the chown command. You may be forced to build a simple chgrp shell
145*219b2ee8SDavid du Colombier    script (put it in your bin) that calls chown. If you're not superuser
146*219b2ee8SDavid du Colombier    set OWNER to your login name and GROUP to your group id.
147*219b2ee8SDavid du Colombier
148*219b2ee8SDavid du Colombier  BSD4_2 - Sun Workstations
149*219b2ee8SDavid du Colombier    Use the Bourne shell. chown is should be in /usr/etc. Add /usr/etc
150*219b2ee8SDavid du Colombier    to your PATH and export PATH. If you're not superuser set OWNER to
151*219b2ee8SDavid du Colombier    your login name and GROUP to your group id.
152*219b2ee8SDavid du Colombier
153*219b2ee8SDavid du Colombier----------------------
154*219b2ee8SDavid du ColombierInstalling The Package
155*219b2ee8SDavid du Colombier----------------------
156*219b2ee8SDavid du Colombier
157*219b2ee8SDavid du ColombierTo build (but not install) the default package (i.e. everything named by
158*219b2ee8SDavid du ColombierTARGETS in postscript.mk) type,
159*219b2ee8SDavid du Colombier
160*219b2ee8SDavid du Colombier	make -f postscript.mk all
161*219b2ee8SDavid du Colombier
162*219b2ee8SDavid du ColombierTo build and install the package type,
163*219b2ee8SDavid du Colombier
164*219b2ee8SDavid du Colombier	make -f postscript.mk all install
165*219b2ee8SDavid du Colombier
166*219b2ee8SDavid du ColombierAfter the package is installed use,
167*219b2ee8SDavid du Colombier
168*219b2ee8SDavid du Colombier	make -f postscript.mk clobber
169*219b2ee8SDavid du Colombier
170*219b2ee8SDavid du Colombierto delete binary files and compiled programs from the source directories.
171*219b2ee8SDavid du Colombier
172*219b2ee8SDavid du ColombierTo select part of the package define TARGETS on the command line. For
173*219b2ee8SDavid du Colombierexample,
174*219b2ee8SDavid du Colombier
175*219b2ee8SDavid du Colombier	make -f postscript.mk TARGETS="dpost devpost" all install
176*219b2ee8SDavid du Colombier
177*219b2ee8SDavid du Colombierbuilds and installs dpost and the PostScript font tables. Quotes hide
178*219b2ee8SDavid du Colombierwhite space from the shell.
179*219b2ee8SDavid du Colombier
180