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