annotate lisp/packages/ps-print.el @ 209:41ff10fd062f r20-4b3

Import from CVS: tag r20-4b3
author cvs
date Mon, 13 Aug 2007 10:04:58 +0200
parents 318232e2a3f0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; ps-print.el --- Jim's Pretty-Good PostScript Generator for Emacs 19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3 ;; Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
5 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
96
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
6 ;; Maintainer: Jacques Duthen <duthen@club-internet.fr>
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
7 ;; Keywords: print, PostScript
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
8 ;; Time-stamp: <97/01/29 23:21:25 tjchol01>
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
9 ;; Version: 3.05
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
10
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
11 (defconst ps-print-version "3.05"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
12 "ps-print.el, v 3.05 <97/01/17 duthen>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
13
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
14 Jack's last change version -- this file may have been edited as part of
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
15 Emacs without changes to the version number. When reporting bugs,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
16 please also report the version of Emacs, if any, that ps-print was
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
17 distributed with.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
18
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
19 Please send all bug fixes and enhancements to
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
20 Jacques Duthen <duthen@cegelec-red.fr>.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
21 ")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
22
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
23 ;; This file is part of GNU Emacs.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
24
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
25 ;; GNU Emacs is free software; you can redistribute it and/or modify
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
26 ;; it under the terms of the GNU General Public License as published by
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
30 ;; GNU Emacs is distributed in the hope that it will be useful,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
31 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
32 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
33 ;; GNU General Public License for more details.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; You should have received a copy of the GNU General Public License
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
36 ;; along with GNU Emacs; see the file COPYING. If not, write to the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
37 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
38 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; LCD Archive Entry:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; ps-print|James C. Thompson|thompson@wg2.waii.com|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; Jim's Pretty-Good PostScript Generator for Emacs 19 (ps-print)|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; 26-Feb-1994|2.8|~/packages/ps-print.el|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
45 ;; 3.05 [jack] <97/01/16 duthen>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
46 ;; Ben Wing <ben@666.com> took ps-print.el from the official 19.34
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
47 ;; GNU distribution:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
48 ;; -rw-rw-r-- 1 duthen 69315 Jul 22 1996 ps-print.el
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
49 ;; He patched it for XEmacs.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
50 ;; Steven L Baur <steve@miranova.com> sent me this version which has
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
51 ;; 26 diffs with 19.34.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
52 ;; I merge these 26 diffs into my 3.04 version.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
53
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
54 ;; `ps-paper-type': ###autoload.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
55 ;; `ps-print-color-p' `ps-color-values': Replace pixel-components by
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
56 ;; color-instance-rgb-components for XEmacs.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
57 ;; `ps-color-device': New function to dynamically test the device
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
58 ;; color capability, added where ps-print-color-p is tested.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
59 ;; `ps-xemacs-face-kind-p': Fixed.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
60 ;; `ps-do-despool': Permit dynamic evaluation at print time of
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
61 ;; ps-lpr-switches.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
62 ;; `ps-eval-switch' `ps-flatten-list' `ps-flatten-list-1': New for
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
63 ;; the previous feature.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
64 ;; `ps-gnus-print-article-from-summary': Updated for Gnus 5.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
65
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
66
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
67 ;; 3.04 [jack] after [simon] Oct 8, 1996 Simon Marshall <simon@gnu.ai.mit.edu>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
68 ;; `ps-print-version':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
69 ;; Fix value.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
70 ;; `cl' `lisp-float-type':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
71 ;; Require them.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
72 ;; `ps-number-of-columns' `ps-*-font-size':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
73 ;; Try to select defaults better suited when `ps-landscape-mode' is non-nil.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
74 ;; `ps-*-faces':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
75 ;; Change default for Font Lock mode faces when `ps-print-color-p' is nil.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
76 ;; `ps-right-header':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
77 ;; Replace `time-stamp-yy/mm/dd' by `time-stamp-mon-dd-yyyy'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
78 ;; `ps-end-file' `ps-begin-page':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
79 ;; Fix bug in page count for Ghostview.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
80 ;; `ps-generate-postscript-with-faces':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
81 ;; Replace `ps-sorter' by `car-less-than-car'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
82 ;; `ps-plot' `ps-generate':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
83 ;; Replace `%d' by `%3d'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
84
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
85 ;; 3.03 [jack] Sept 27, 1996 Jacques Duthen <duthen@cegelec-red.fr>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
86 ;; Merge 31 diffs between 19.29 and 19.34
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
87
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
88 ;; 3.02 [jack] June 26, 1996 Jacques Duthen <duthen@cegelec-red.fr>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
89 ;; Add new page dimensions to `ps-page-dimensions-database' for `paper-type'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
90 ;; Improve landscape mode `ps-landscape-mode' and multiple columns
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
91 ;; printing `ps-number-of-columns':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
92 ;; The text and the margins are no more scaled.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
93 ;; Simplify the semantics of `ps-inter-column' (space between columns).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
94 ;; Add error checking for negative `ps-print-width' and `ps-print-height'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
95 ;; Change the semantics of `ps-top-margin' which is now the TOP MARGIN,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
96 ;; and add `ps-header-offset' instead of having `ps-top-margin' split in 2.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
97 ;; Add `ps-header-font-family', `ps-header-font-size' and
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
98 ;; `ps-header-title-font-size' to control the header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
99 ;; Add `ps-header-line-pad'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
100 ;; Change the semantics of `ps-font-info-database' to have symbolic
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
101 ;; font families.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
102 ;; Add new fonts to `ps-font-info-database': `Courier' `Helvetica'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
103 ;; `Times' `Palatino' `Helvetica-Narrow' `NewCenturySchlbk'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
104 ;; Make public `ps-font-family' and `ps-font-size' so that the user
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
105 ;; can directly control the text font and size without loading ps-print.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
106 ;; Add error checking for unknown font families and a message giving
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
107 ;; the exhaustive list of available font families.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
108 ;; Document how to install a new font family.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
109 ;; Add `/ReportAllFontInfo' to get all the font families of the printer.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
110 ;; Add the possibility to make `mixed' font families.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
111 ;; Add `ps-setup' to get the current setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
112 ;; Add tools `ps-line-lengths' `ps-nb-pages-buffer' `ps-nb-pages-region'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
113 ;; to help choose the font size.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
114 ;; Split `ps-print-prologue' in two to insert info from header fonts
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
115 ;; Replace indexes by macro `ps-page-dimensions-get-width'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
116 ;; to get access to the dimensions list.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
117 ;; Add `ps-select-font' inside `ps-get-page-dimensions'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
118 ;; Fix the "clumsy" `ps-page-height' management.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
119 ;; Move `ps-get-page-dimensions' to the beginning of `ps-begin-file'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
120 ;; to get early error checking.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
121 ;; Add sample setup `ps-jack-setup'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
122 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
123 ;; Rewrite a lot of postscript code and add comments inside it
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
124 ;; (maybe they should not (or optionally) be included in the generated
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
125 ;; Postscript).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
126 ;; Translate the origin to (lm, bm) to simplify the other moves.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
127 ;; Fix bug in `/HeaderOffset' with `/PrintStartY'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
128 ;; Fix bug in `/SetHeaderLines'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
129 ;; Change `/ReportFontInfo' for use by `/ReportAllFontInfo'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
130
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
131 ;; 3.01 [jack] June 4, 1996 Jacques Duthen <duthen@cegelec-red.fr>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
132 ;; Manage float value for every variable representing a size.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
133 ;; Add `ps-font-info-database' `ps-inter-column'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
134
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
135 ;; 3.00 [jack] May 17, 1996 Jacques Duthen <duthen@cegelec-red.fr>
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
136 ;; based on 2.8 Jim's Pretty-Good version:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
137 ;; Add `ps-landscape-mode' and `ps-number-of-columns'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
138 ;; for dumb multi-column landscape mode.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
139
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;; Baseline-version: 2.8. (Jim's last change version -- this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;; file may have been edited as part of Emacs without changes to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;; version number. When reporting bugs, please also report the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;; version of Emacs, if any, that ps-print was distributed with.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;; About ps-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;; --------------
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
151 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;; This package provides printing of Emacs buffers on PostScript
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; printers; the buffer's bold and italic text attributes are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; preserved in the printer output. Ps-print is intended for use with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;; Emacs 19 or Lucid Emacs, together with a fontifying package such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;; font-lock or hilit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
158 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; Using ps-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;; --------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;; The Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ;; Ps-print provides eight commands for generating PostScript images
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ;; of Emacs buffers:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ;; ps-print-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ;; ps-print-buffer-with-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ;; ps-print-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ;; ps-print-region-with-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ;; ps-spool-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ;; ps-spool-buffer-with-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ;; ps-spool-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;; ps-spool-region-with-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;; These commands all perform essentially the same function: they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ;; generate PostScript images suitable for printing on a PostScript
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ;; printer or displaying with GhostScript. These commands are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ;; collectively referred to as "ps-print- commands".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ;; The word "print" or "spool" in the command name determines when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ;; PostScript image is sent to the printer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ;; print - The PostScript image is immediately sent to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; printer;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ;; spool - The PostScript image is saved temporarily in an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; Emacs buffer. Many images may be spooled locally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; before printing them. To send the spooled images
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
190 ;; to the printer, use the command `ps-despool'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ;; The spooling mechanism was designed for printing lots of small
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;; files (mail messages or netnews articles) to save paper that would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;; otherwise be wasted on banner pages, and to make it easier to find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ;; your output at the printer (it's easier to pick up one 50-page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ;; printout than to find 50 single-page printouts).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
198 ;; Ps-print has a hook in the `kill-emacs-hooks' so that you won't
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
199 ;; accidentally quit from Emacs while you have unprinted PostScript
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;; waiting in the spool buffer. If you do attempt to exit with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ;; spooled PostScript, you'll be asked if you want to print it, and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;; you decline, you'll be asked to confirm the exit; this is modeled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;; on the confirmation that Emacs uses for modified buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ;; The word "buffer" or "region" in the command name determines how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;; much of the buffer is printed:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ;; buffer - Print the entire buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ;; region - Print just the current region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ;; The -with-faces suffix on the command name means that the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ;; will include font, color, and underline information in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ;; PostScript image, so the printed image can look as pretty as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ;; buffer. The ps-print- commands without the -with-faces suffix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;; don't include font, color, or underline information; images printed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ;; with these commands aren't as pretty, but are faster to generate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ;; Two ps-print- command examples:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ;; ps-print-buffer - print the entire buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ;; without font, color, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ;; underline information, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;; send it immediately to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ;; printer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ;; ps-spool-region-with-faces - print just the current region;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;; include font, color, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ;; underline information, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ;; spool the image in Emacs to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ;; send to the printer later.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ;; Invoking Ps-Print
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
235 ;; -----------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ;; To print your buffer, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; M-x ps-print-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; or substitute one of the other seven ps-print- commands. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; command will generate the PostScript image and print or spool it as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;; specified. By giving the command a prefix argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ;; C-u M-x ps-print-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;; it will save the PostScript image to a file instead of sending it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;; to the printer; you will be prompted for the name of the file to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;; save the image to. The prefix argument is ignored by the commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;; that spool their images, but you may save the spooled images to a
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
251 ;; file by giving a prefix argument to `ps-despool':
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 ;; C-u M-x ps-despool
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
255 ;; When invoked this way, `ps-despool' will prompt you for the name of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ;; the file to save to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
258 ;; Any of the `ps-print-' commands can be bound to keys; I recommend
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
259 ;; binding `ps-spool-buffer-with-faces', `ps-spool-region-with-faces',
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
260 ;; and `ps-despool'. Here are the bindings I use on my Sun 4 keyboard:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; (global-set-key 'f22 'ps-spool-buffer-with-faces) ;f22 is prsc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; (global-set-key '(shift f22) 'ps-spool-region-with-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; (global-set-key '(control f22) 'ps-despool)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ;; The Printer Interface
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
268 ;; ---------------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
270 ;; The variables `ps-lpr-command' and `ps-lpr-switches' determine what
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
271 ;; command is used to send the PostScript images to the printer, and
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
272 ;; what arguments to give the command. These are analogous to
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
273 ;; `lpr-command' and `lpr-switches'.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 6
diff changeset
274 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
275 ;; Make sure that they contain appropriate values for your system;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
276 ;; see the usage notes below and the documentation of these variables.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
277 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
278 ;; NOTE: `ps-lpr-command' and `ps-lpr-switches' take their initial values
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
279 ;; from the variables `lpr-command' and `lpr-switches'. If you have
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
280 ;; `lpr-command' set to invoke a pretty-printer such as `enscript',
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
281 ;; then ps-print won't work properly. `ps-lpr-command' must name
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ;; a program that does not format the files it prints.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
285 ;; The Page Layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
286 ;; ---------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
288 ;; All dimensions are floats in PostScript points.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
289 ;; 1 inch == 2.54 cm == 72 points
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
290 ;; 1 cm == (/ 1 2.54) inch == (/ 72 2.54) points
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
292 ;; The variable `ps-paper-type' determines the size of paper ps-print
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
293 ;; formats for; it should contain one of the symbols:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
294 ;; `a4' `a3' `letter' `legal' `letter-small' `tabloid'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
295 ;; `ledger' `statement' `executive' `a4small' `b4' `b5'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
297 ;; The variable `ps-landscape-mode' determines the orientation
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
298 ;; of the printing on the page:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
299 ;; nil means `portrait' mode, non-nil means `landscape' mode.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
300 ;; There is no oblique mode yet, though this is easy to do in ps.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
301
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
302 ;; In landscape mode, the text is NOT scaled: you may print 70 lines
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
303 ;; in portrait mode and only 50 lignes in landscape mode.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
304 ;; The margins represent margins in the printed paper:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
305 ;; the top margin is the margin between the top of the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
306 ;; and the printed header, whatever the orientation is.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
308 ;; The variable `ps-number-of-columns' determines the number of columns
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
309 ;; both in landscape and portrait mode.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
310 ;; You can use:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
311 ;; - (the standard) one column portrait mode
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
312 ;; - (my favorite) two columns landscape mode (which spares trees)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
313 ;; but also
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
314 ;; - one column landscape mode for files with very long lines.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
315 ;; - multi-column portrait or landscape mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
318 ;; Horizontal layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
319 ;; -----------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
320 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
321 ;; The horizontal layout is determined by the variables
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
322 ;; `ps-left-margin' `ps-inter-column' `ps-right-margin'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
323 ;; as follows:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
324 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
325 ;; ------------------------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
326 ;; | | | | | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
327 ;; | lm | text | ic | text | ic | text | rm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
328 ;; | | | | | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
329 ;; ------------------------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
330 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
331 ;; If `ps-number-of-columns' is 1, `ps-inter-column' is not relevant.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
332 ;; Usually, lm = rm > 0 and ic = lm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
333 ;; If (ic < 0), the text of adjacent columns can overlap.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
334 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
335 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
336 ;; Vertical layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
337 ;; ---------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
339 ;; The vertical layout is determined by the variables
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
340 ;; `ps-bottom-margin' `ps-top-margin' `ps-header-offset'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
341 ;; as follows:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
342 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
343 ;; |--------| |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
344 ;; | tm | | tm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
345 ;; |--------| |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
346 ;; | header | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
347 ;; |--------| | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
348 ;; | ho | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
349 ;; |--------| or | text |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
350 ;; | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
351 ;; | text | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
352 ;; | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
353 ;; |--------| |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
354 ;; | bm | | bm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
355 ;; |--------| |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
356 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
357 ;; If `ps-print-header' is nil, `ps-header-offset' is not relevant.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
358 ;; The margins represent margins in the printed paper:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
359 ;; the top margin is the margin between the top of the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
360 ;; and the printed header, whatever the orientation is.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ;; Headers
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
364 ;; -------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
366 ;; Ps-print can print headers at the top of each column; the default
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 ;; headers contain the following four items: on the left, the name of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 ;; the buffer and, if the buffer is visiting a file, the file's
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
369 ;; directory; on the right, the page number and date of printing.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
370 ;; The default headers look something like this:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 ;; ps-print.el 1/21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ;; /home/jct/emacs-lisp/ps/new 94/12/31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 ;; When printing on duplex printers, left and right are reversed so
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
376 ;; that the page numbers are toward the outside (cf. `ps-spool-duplex').
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
377 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
378 ;; Headers are configurable:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
379 ;; To turn them off completely, set `ps-print-header' to nil.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
380 ;; To turn off the header's gaudy framing box,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
381 ;; set `ps-print-header-frame' to nil.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
383 ;; The font family and size of text in the header are determined
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
384 ;; by the variables `ps-header-font-family', `ps-header-font-size' and
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
385 ;; `ps-header-title-font-size' (see below).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
386 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
387 ;; The variable `ps-header-line-pad' determines the portion of a header
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
388 ;; title line height to insert between the header frame and the text
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
389 ;; it contains, both in the vertical and horizontal directions:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
390 ;; .5 means half a line.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
391
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
392 ;; Page numbers are printed in `n/m' format, indicating page n of m pages;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
393 ;; to omit the total page count and just print the page number,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
394 ;; set `ps-show-n-of-n' to nil.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 ;; The amount of information in the header can be changed by changing
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
397 ;; the number of lines. To show less, set `ps-header-lines' to 1, and
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 ;; the header will show only the buffer name and page number. To show
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
399 ;; more, set `ps-header-lines' to 3, and the header will show the time of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 ;; printing below the date.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 ;; To change the content of the headers, change the variables
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
403 ;; `ps-left-header' and `ps-right-header'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
404 ;; These variables are lists, specifying top-to-bottom the text
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
405 ;; to display on the left or right side of the header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
406 ;; Each element of the list should be a string or a symbol.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
407 ;; Strings are inserted directly into the PostScript arrays,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
408 ;; and should contain the PostScript string delimiters '(' and ')'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;; Symbols in the header format lists can either represent functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ;; or variables. Functions are called, and should return a string to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 ;; show in the header. Variables should contain strings to display in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 ;; the header. In either case, function or variable, the PostScript
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
414 ;; string delimiters are added by ps-print, and should not be part of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ;; the returned value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ;; Here's an example: say we want the left header to display the text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 ;; Moe
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 ;; Larry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 ;; Curly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 ;; where we have a function to return "Moe"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 ;; (defun moe-func ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 ;; "Moe")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ;; a variable specifying "Larry"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 ;; (setq larry-var "Larry")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
432 ;; and a literal for "Curly". Here's how `ps-left-header' should be
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 ;; set:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 ;; (setq ps-left-header (list 'moe-func 'larry-var "(Curly)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 ;; Note that Curly has the PostScript string delimiters inside his
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
438 ;; quotes -- those aren't misplaced lisp delimiters!
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
439 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
440 ;; Without them, PostScript would attempt to call the undefined
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
441 ;; function Curly, which would result in a PostScript error.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
442 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
443 ;; Since most printers don't report PostScript errors except by
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
444 ;; aborting the print job, this kind of error can be hard to track down.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
445 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
446 ;; Consider yourself warned!
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 ;; Duplex Printers
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
450 ;; ---------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 ;; If you have a duplex-capable printer (one that prints both sides of
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
453 ;; the paper), set `ps-spool-duplex' to t.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
454 ;; Ps-print will insert blank pages to make sure each buffer starts
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
455 ;; on the correct side of the paper.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
456 ;; Don't forget to set `ps-lpr-switches' to select duplex printing
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
457 ;; for your printer.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
458 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
459 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
460 ;; Font managing
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
461 ;; -------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
462 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
463 ;; Ps-print now knows rather precisely some fonts:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
464 ;; the variable `ps-font-info-database' contains information
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
465 ;; for a list of font families (currently mainly `Courier' `Helvetica'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
466 ;; `Times' `Palatino' `Helvetica-Narrow' `NewCenturySchlbk').
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
467 ;; Each font family contains the font names for standard, bold, italic
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
468 ;; and bold-italic characters, a reference size (usually 10) and the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
469 ;; corresponding line height, width of a space and average character width.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
471 ;; The variable `ps-font-family' determines which font family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
472 ;; is to be used for ordinary text.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
473 ;; If its value does not correspond to a known font family,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
474 ;; an error message is printed into the `*Messages*' buffer,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
475 ;; which lists the currently available font families.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 6
diff changeset
476 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
477 ;; The variable `ps-font-size' determines the size (in points)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
478 ;; of the font for ordinary text, when generating Postscript.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
479 ;; Its value is a float.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
480 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
481 ;; Similarly, the variable `ps-header-font-family' determines
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
482 ;; which font family is to be used for text in the header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
483 ;; The variable `ps-header-font-size' determines the font size,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
484 ;; in points, for text in the header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
485 ;; The variable `ps-header-title-font-size' determines the font size,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
486 ;; in points, for the top line of text in the header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
487 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
488 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
489 ;; Adding a new font family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
490 ;; ------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
491 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
492 ;; To use a new font family, you MUST first teach ps-print
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
493 ;; this font, i.e., add its information to `ps-font-info-database',
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
494 ;; otherwise ps-print cannot correctly place line and page breaks.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
495 ;;
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
496 ;; For example, assuming `Helvetica' is unknown,
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
497 ;; you first need to do the following ONLY ONCE:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
498 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
499 ;; - create a new buffer
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
500 ;; - generate the PostScript image to a file (C-u M-x ps-print-buffer)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
501 ;; - open this file and find the line:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
502 ;; `% 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
503 ;; - delete the leading `%' (which is the Postscript comment character)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
504 ;; - replace in this line `Courier' by the new font (say `Helvetica')
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
505 ;; to get the line:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
506 ;; `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
507 ;; - send this file to the printer (or to ghostscript).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
508 ;; You should read the following on the output page:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
509 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
510 ;; For Helvetica 10 point, the line height is 11.56, the space width is 2.78
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
511 ;; and a crude estimate of average character width is 5.09243
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
512 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
513 ;; - Add these values to the `ps-font-info-database':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
514 ;; (setq ps-font-info-database
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
515 ;; (append
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
516 ;; '((Helvetica ; the family name
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
517 ;; "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
518 ;; 10.0 11.56 2.78 5.09243))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
519 ;; ps-font-info-database))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
520 ;; - Now you can use this font family with any size:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
521 ;; (setq ps-font-family 'Helvetica)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
522 ;; - if you want to use this family in another emacs session, you must
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
523 ;; put into your `~/.emacs':
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
524 ;; (require 'ps-print)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
525 ;; (setq ps-font-info-database (append ...)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
526 ;; if you don't want to load ps-print, you have to copy the whole value:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
527 ;; (setq ps-font-info-database '(<your stuff> <the standard stuff>))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
528 ;; or, if you can wait until the `ps-print-hook' is implemented, do:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
529 ;; (add-hook 'ps-print-hook '(setq ps-font-info-database (append ...)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
530 ;; This does not work yet, since there is no `ps-print-hook' yet.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
532 ;; You can create new `mixed' font families like:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
533 ;; (my-mixed-family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
534 ;; "Courier-Bold" "Helvetica"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
535 ;; "Zapf-Chancery-MediumItalic" "NewCenturySchlbk-BoldItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
536 ;; 10.0 10.55 6.0 6.0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
537 ;; Now you can use your new font family with any size:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
538 ;; (setq ps-font-family 'my-mixed-family)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
539 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
540 ;; You can get information on all the fonts resident in YOUR printer
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
541 ;; by uncommenting the line:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
542 ;; % 3 cm 20 cm moveto ReportAllFontInfo showpage
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
543 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
544 ;; The postscript file should be sent to YOUR postscript printer.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
545 ;; If you send it to ghostscript or to another postscript printer,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
546 ;; you may get slightly different results.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
547 ;; Anyway, as ghostscript fonts are autoload, you won't get
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
548 ;; much font info.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
549 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
550 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
551 ;; How Ps-Print Deals With Faces
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
552 ;; -----------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
553 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
554 ;; The ps-print-*-with-faces commands attempt to determine which faces
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
555 ;; should be printed in bold or italic, but their guesses aren't
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
556 ;; always right. For example, you might want to map colors into faces
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
557 ;; so that blue faces print in bold, and red faces in italic.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
558 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
559 ;; It is possible to force ps-print to consider specific faces bold or
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
560 ;; italic, no matter what font they are displayed in, by setting the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
561 ;; variables `ps-bold-faces' and `ps-italic-faces'. These variables
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
562 ;; contain lists of faces that ps-print should consider bold or
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
563 ;; italic; to set them, put code like the following into your .emacs
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
564 ;; file:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
565 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
566 ;; (setq ps-bold-faces '(my-blue-face))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
567 ;; (setq ps-italic-faces '(my-red-face))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
568 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
569 ;; Faces like bold-italic that are both bold and italic should go in
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
570 ;; *both* lists.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
572 ;; Ps-print keeps internal lists of which fonts are bold and which are
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
573 ;; italic; these lists are built the first time you invoke ps-print.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
574 ;; For the sake of efficiency, the lists are built only once; the same
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
575 ;; lists are referred in later invocations of ps-print.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
576 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
577 ;; Because these lists are built only once, it's possible for them to
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
578 ;; get out of sync, if a face changes, or if new faces are added. To
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
579 ;; get the lists back in sync, you can set the variable
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
580 ;; `ps-build-face-reference' to t, and the lists will be rebuilt the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
581 ;; next time ps-print is invoked.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
582 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
583 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
584 ;; How Ps-Print Deals With Color
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
585 ;; -----------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
586 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
587 ;; Ps-print detects faces with foreground and background colors
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
588 ;; defined and embeds color information in the PostScript image.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
589 ;; The default foreground and background colors are defined by the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
590 ;; variables `ps-default-fg' and `ps-default-bg'.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
591 ;; On black-and-white printers, colors are displayed in grayscale.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
592 ;; To turn off color output, set `ps-print-color-p' to nil.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
593 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
594 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
595 ;; Utilities
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
596 ;; ---------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
597 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
598 ;; Some tools are provided to help you customize your font setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
599 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
600 ;; `ps-setup' returns (some part of) the current setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
601 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
602 ;; To avoid wrapping too many lines, you may want to adjust the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
603 ;; left and right margins and the font size. On UN*X systems, do:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
604 ;; pr -t file | awk '{printf "%3d %s\n", length($0), $0}' | sort -r | head
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
605 ;; to determine the longest lines of your file.
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
606 ;; Then, the command `ps-line-lengths' will give you the correspondence
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
607 ;; between a line length (number of characters) and the maximum font
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
608 ;; size which doesn't wrap such a line with the current ps-print setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
609 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
610 ;; The commands `ps-nb-pages-buffer' and `ps-nb-pages-region' display
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
611 ;; the correspondence between a number of pages and the maximum font
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
612 ;; size which allow the number of lines of the current buffer or of
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
613 ;; its current region to fit in this number of pages.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
614 ;; Note: line folding is not taken into account in this process
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
615 ;; and could change the results.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
616 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
617 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 ;; New since version 1.5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 ;; ---------------------
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
620 ;;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
621 ;; Color output capability.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 ;; Automatic detection of font attributes (bold, italic).
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
623 ;; Configurable headers with page numbers.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
624 ;; Slightly faster.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
625 ;; Support for different paper sizes.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
626 ;; Better conformance to PostScript Document Structure Conventions.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
627 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
629 ;; New since version 2.8
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
630 ;; ---------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
631 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
632 ;; [jack] 960517 Jacques Duthen <duthen@cegelec-red.fr>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
634 ;; Font familiy and float size for text and header.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
635 ;; Landscape mode.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
636 ;; Multiple columns.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
637 ;; Tools for page setup.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 ;; Known bugs and limitations of ps-print:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 ;; --------------------------------------
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
642 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 ;; Although color printing will work in XEmacs 19.12, it doesn't work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 ;; well; in particular, bold or italic fonts don't print in the right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 ;; background color.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 ;; Invisible properties aren't correctly ignored in XEmacs 19.12.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 ;; Automatic font-attribute detection doesn't work well, especially
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 ;; with hilit19 and older versions of get-create-face. Users having
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
651 ;; problems with auto-font detection should use the lists
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
652 ;; `ps-italic-faces' and `ps-bold-faces' and/or turn off automatic
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
653 ;; detection by setting `ps-auto-font-detect' to nil.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 ;; Automatic font-attribute detection doesn't work with XEmacs 19.12
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
656 ;; in tty mode; use the lists `ps-italic-faces' and `ps-bold-faces'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 ;; instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 ;; Still too slow; could use some hand-optimization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 ;; ASCII Control characters other than tab, linefeed and pagefeed are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 ;; not handled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 ;; Default background color isn't working.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 ;; Faces are always treated as opaque.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 ;; Epoch and Emacs 18 not supported. At all.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
670 ;; Fixed-pitch fonts work better for line folding, but are not required.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
672 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' don't take care
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
673 ;; of folding lines.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
674 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
675 ;;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
676 ;; Things to change:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
677 ;; ----------------
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
678 ;;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
679 ;; Add `ps-print-hook' (I don't know how to do that (yet!)).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
680 ;; Add 4-up capability (really needed?).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
681 ;; Add line numbers (should not be too hard).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
682 ;; Add `ps-non-bold-faces' and `ps-non-italic-faces' (should be easy).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
683 ;; Put one header per page over the columns (easy but needed?).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
684 ;; Improve the memory management for big files (hard?).
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
685 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' should take care
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
686 ;; of folding lines.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 ;; Acknowledgements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 ;; ----------------
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
691 ;; Thanks to Jim Thompson <?@?> for the 2.8 version I started from.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
692 ;; [jack]
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
693 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 ;; Thanks to Kevin Rodgers <kevinr@ihs.com> for adding support for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 ;; color and the invisible property.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 ;; Thanks to Avishai Yacobi, avishaiy@mcil.comm.mot.com, for writing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 ;; the initial port to Emacs 19. His code is no longer part of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 ;; ps-print, but his work is still appreciated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 ;; Thanks to Remi Houdaille and Michel Train, michel@metasoft.fdn.org,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 ;; for adding underline support. Their code also is no longer part of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 ;; ps-print, but their efforts are not forgotten.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 ;; Thanks also to all of you who mailed code to add features to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 ;; ps-print; although I didn't use your code, I still appreciate your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 ;; sharing it with me.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 ;; Thanks to all who mailed comments, encouragement, and criticism.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 ;; Thanks also to all who responded to my survey; I had too many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 ;; responses to reply to them all, but I greatly appreciate your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 ;; interest.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 ;; Jim
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
719 (eval-when-compile
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
720 (require 'cl))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
721
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
722 (unless (featurep 'lisp-float-type)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
723 (error "`ps-print' requires floating point support"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 ;; User Variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
728 ;;; Interface to the command system
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
729
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
730 (defgroup ps-print nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
731 "Postscript generator for Emacs 19"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
732 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
733 :group 'wp)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
734
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
735 (defgroup ps-print-horizontal nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
736 "Horizontal page layout"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
737 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
738 :tag "Horizontal"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
739 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
740
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
741 (defgroup ps-print-vertical nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
742 "Vertical page layout"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
743 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
744 :tag "Vertical"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
745 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
746
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
747 (defgroup ps-print-header nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
748 "Headers layout"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
749 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
750 :tag "Header"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
751 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
752
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
753 (defgroup ps-print-font nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
754 "Fonts customization"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
755 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
756 :tag "Font"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
757 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
758
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
759 (defgroup ps-print-color nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
760 "Color customization"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
761 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
762 :tag "Color"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
763 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
764
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
765 (defgroup ps-print-face nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
766 "Faces customization"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
767 :prefix "ps-"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
768 :tag "PS Faces"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
769 :group 'ps-print
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
770 :group 'faces)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
771
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
772
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
773 (defcustom ps-lpr-command lpr-command
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
774 "*The shell command for printing a PostScript file."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
775 :type 'string
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
776 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
777
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
778 (defcustom ps-lpr-switches lpr-switches
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
779 "*A list of extra switches to pass to `ps-lpr-command'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
780 :type '(repeat string)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
781 :group 'ps-print)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
783 ;;; Page layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
784
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
785 ;; All page dimensions are in PostScript points.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
786 ;; 1 inch == 2.54 cm == 72 points
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
787 ;; 1 cm == (/ 1 2.54) inch == (/ 72 2.54) points
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
788
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
789 ;; Letter 8.5 inch x 11.0 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
790 ;; Legal 8.5 inch x 14.0 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
791 ;; A4 8.26 inch x 11.69 inch = 21.0 cm x 29.7 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
792
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
793 ;; LetterSmall 7.68 inch x 10.16 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
794 ;; Tabloid 11.0 inch x 17.0 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
795 ;; Ledger 17.0 inch x 11.0 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
796 ;; Statement 5.5 inch x 8.5 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
797 ;; Executive 7.5 inch x 10.0 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
798 ;; A3 11.69 inch x 16.5 inch = 29.7 cm x 42.0 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
799 ;; A4Small 7.47 inch x 10.85 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
800 ;; B4 10.125 inch x 14.33 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
801 ;; B5 7.16 inch x 10.125 inch
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
802
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
803 (defcustom ps-page-dimensions-database
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
804 (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
805 (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
806 (list 'letter (* 72 8.5) (* 72 11.0))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
807 (list 'legal (* 72 8.5) (* 72 14.0))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
808 (list 'letter-small (* 72 7.68) (* 72 10.16))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
809 (list 'tabloid (* 72 11.0) (* 72 17.0))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
810 (list 'ledger (* 72 17.0) (* 72 11.0))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
811 (list 'statement (* 72 5.5) (* 72 8.5))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
812 (list 'executive (* 72 7.5) (* 72 10.0))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
813 (list 'a4small (* 72 7.47) (* 72 10.85))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
814 (list 'b4 (* 72 10.125) (* 72 14.33))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
815 (list 'b5 (* 72 7.16) (* 72 10.125)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
816 "*List associating a symbolic paper type to its width and height.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
817 see `ps-paper-type'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
818 :type '(repeat (list :tag "Paper Type"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
819 (symbol :tag "Name")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
820 (number :tag "Width")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
821 (number :tag "Height")))
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
822 :group 'ps-print)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 ;;;###autoload
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
825 (defcustom ps-paper-type 'letter
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
826 "*Specifies the size of paper to format for.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
827 Should be one of the paper types defined in `ps-page-dimensions-database', for
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
828 example `letter', `legal' or `a4'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
829 :type '(symbol :validate (lambda (wid)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
830 (if (assq (widget-value wid) ps-page-dimensions-database)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
831 nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
832 (widget-put wid :error "Unknown paper size")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
833 wid)))
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
834 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
835
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
836 (defcustom ps-landscape-mode 'nil
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
837 "*Non-nil means print in landscape mode."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
838 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
839 :group 'ps-print)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
840
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
841 (defcustom ps-number-of-columns (if ps-landscape-mode 2 1)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
842 "*Specifies the number of columns"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
843 :type 'integer
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
844 :group 'ps-print)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
845
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
846 ;;; Horizontal layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
847
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
848 ;; ------------------------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
849 ;; | | | | | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
850 ;; | lm | text | ic | text | ic | text | rm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
851 ;; | | | | | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
852 ;; ------------------------------------------
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
853
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
854 (defcustom ps-left-margin (/ (* 72 2.0) 2.54) ; 2 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
855 "*Left margin in points (1/72 inch)."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
856 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
857 :group 'ps-print-horizontal)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
858
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
859 (defcustom ps-right-margin (/ (* 72 2.0) 2.54) ; 2 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
860 "*Right margin in points (1/72 inch)."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
861 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
862 :group 'ps-print-horizontal)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
863
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
864 (defcustom ps-inter-column (/ (* 72 2.0) 2.54) ; 2 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
865 "*Horizontal space between columns in points (1/72 inch)."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
866 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
867 :group 'ps-print-horizontal)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
868
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
869 ;;; Vertical layout
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
870
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
871 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
872 ;; | tm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
873 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
874 ;; | header |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
875 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
876 ;; | ho |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
877 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
878 ;; | text |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
879 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
880 ;; | bm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
881 ;; |--------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
882
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
883 (defcustom ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
884 "*Bottom margin in points (1/72 inch)."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
885 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
886 :group 'ps-print-vertical)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
887
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
888 (defcustom ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
889 "*Top margin in points (1/72 inch)."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
890 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
891 :group 'ps-print-vertical)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
892
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
893 (defcustom ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
894 "*Vertical space in points (1/72 inch) between the main text and the header."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
895 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
896 :group 'ps-print-vertical)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
897
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
898 (defcustom ps-header-line-pad 0.15
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
899 "*Portion of a header title line height to insert between the header frame
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
900 and the text it contains, both in the vertical and horizontal directions."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
901 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
902 :group 'ps-print-vertical)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
903
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
904 ;;; Header setup
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
906 (defcustom ps-print-header t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 "*Non-nil means print a header at the top of each page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 By default, the header displays the buffer name, page number, and, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 the buffer is visiting a file, the file's directory. Headers are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 customizable by changing variables `ps-header-left' and
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
911 `ps-header-right'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
912 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
913 :group 'ps-print-header)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
914
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
915 (defcustom ps-print-header-frame t
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
916 "*Non-nil means draw a gaudy frame around the header."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
917 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
918 :group 'ps-print-header)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
919
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
920 (defcustom ps-header-lines 2
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
921 "*Number of lines to display in page header, when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
922 :type 'integer
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
923 :group 'ps-print-header)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
924 (make-variable-buffer-local 'ps-header-lines)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
925
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
926 (defcustom ps-show-n-of-n t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 "*Non-nil means show page numbers as N/M, meaning page N of M.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 Note: page numbers are displayed as part of headers, see variable
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
929 `ps-print-headers'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
930 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
931 :group 'ps-print-header)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
932
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
933 (defcustom ps-spool-duplex nil ; Not many people have duplex
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
934 ; printers, so default to nil.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
935 "*Non-nil indicates spooling is for a two-sided printer.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
936 For a duplex printer, the `ps-spool-*' commands will insert blank pages
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
937 as needed between print jobs so that the next buffer printed will
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
938 start on the right page. Also, if headers are turned on, the headers
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
939 will be reversed on duplex printers so that the page numbers fall to
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
940 the left on even-numbered pages."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
941 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
942 :group 'ps-print-header)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
943
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
944 ;;; Fonts
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
945
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
946 (defcustom ps-font-info-database
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
947 '((Courier ; the family key
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
948 "Courier" "Courier-Bold" "Courier-Oblique" "Courier-BoldOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
949 10.0 10.55 6.0 6.0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
950 (Helvetica ; the family key
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
951 "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
952 10.0 11.56 2.78 5.09243)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
953 (Times
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
954 "Times-Roman" "Times-Bold" "Times-Italic" "Times-BoldItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
955 10.0 11.0 2.5 4.71432)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
956 (Palatino
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
957 "Palatino-Roman" "Palatino-Bold" "Palatino-Italic" "Palatino-BoldItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
958 10.0 12.1 2.5 5.08676)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
959 (Helvetica-Narrow
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
960 "Helvetica-Narrow" "Helvetica-Narrow-Bold"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
961 "Helvetica-Narrow-Oblique" "Helvetica-Narrow-BoldOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
962 10.0 11.56 2.2796 4.17579)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
963 (NewCenturySchlbk
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
964 "NewCenturySchlbk-Roman" "NewCenturySchlbk-Bold"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
965 "NewCenturySchlbk-Italic" "NewCenturySchlbk-BoldItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
966 10.0 12.15 2.78 5.31162)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
967 ;; got no bold for the next ones
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
968 (AvantGarde-Book
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
969 "AvantGarde-Book" "AvantGarde-Book"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
970 "AvantGarde-BookOblique" "AvantGarde-BookOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
971 10.0 11.77 2.77 5.45189)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
972 (AvantGarde-Demi
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
973 "AvantGarde-Demi" "AvantGarde-Demi"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
974 "AvantGarde-DemiOblique" "AvantGarde-DemiOblique"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
975 10.0 12.72 2.8 5.51351)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
976 (Bookman-Demi
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
977 "Bookman-Demi" "Bookman-Demi"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
978 "Bookman-DemiItalic" "Bookman-DemiItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
979 10.0 11.77 3.4 6.05946)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
980 (Bookman-Light
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
981 "Bookman-Light" "Bookman-Light"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
982 "Bookman-LightItalic" "Bookman-LightItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
983 10.0 11.79 3.2 5.67027)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
984 ;; got no bold and no italic for the next ones
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
985 (Symbol
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
986 "Symbol" "Symbol" "Symbol" "Symbol"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
987 10.0 13.03 2.5 3.24324)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
988 (Zapf-Dingbats
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
989 "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
990 10.0 9.63 2.78 2.78)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
991 (Zapf-Chancery-MediumItalic
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
992 "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
993 "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
994 10.0 11.45 2.2 4.10811)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
995 )
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
996 "*Font info database: font family (the key), name, bold, italic, bold-italic,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
997 reference size, line height, space width, average character width.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
998 To get the info for another specific font (say Helvetica), do the following:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
999 - create a new buffer
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1000 - generate the PostScript image to a file (C-u M-x ps-print-buffer)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1001 - open this file and delete the leading `%' (which is the Postscript
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1002 comment character) from the line
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1003 `% 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1004 to get the line
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1005 `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1006 - add the values to `ps-font-info-database'.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1007 You can get all the fonts of YOUR printer using `ReportAllFontInfo'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1008 :type '(repeat (list :tag "Font Definition"
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1009 (symbol :tag "Font")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1010 (string :tag "Name")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1011 (string :tag "Bold")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1012 (string :tag "Italic")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1013 (string :tag "Bold-Italic")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1014 (number :tag "Reference Size")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1015 (number :tag "Line Height")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1016 (number :tag "Space Width")
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1017 (number :tag "Average Character Width")))
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1018 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1019
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1020 (defcustom ps-font-family 'Courier
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1021 "Font family name for ordinary text, when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1022 :type 'symbol
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1023 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1024
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1025 (defcustom ps-font-size (if ps-landscape-mode 7 8.5)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1026 "Font size, in points, for ordinary text, when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1027 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1028 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1029
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1030 (defcustom ps-header-font-family 'Helvetica
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1031 "Font family name for text in the header, when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1032 :type 'symbol
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1033 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1034
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1035 (defcustom ps-header-font-size (if ps-landscape-mode 10 12)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1036 "Font size, in points, for text in the header, when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1037 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1038 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1039
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1040 (defcustom ps-header-title-font-size (if ps-landscape-mode 12 14)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1041 "Font size, in points, for the top line of text in the header,
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1042 when generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1043 :type 'number
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1044 :group 'ps-print-font)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1045
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1046 ;;; Colors
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1047
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 ;;;###autoload
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1049 ;;; The 19.33 fsf version includes a test on pixel components instead
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1050 ;;; of color-instance-rgb-components
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1051 (defcustom ps-print-color-p (or (fboundp 'x-color-values) ; fsf
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1052 (fboundp 'color-instance-rgb-components))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 ; xemacs
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1054 ; Printing color requires x-color-values.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1055 "*If non-nil, print the buffer's text in color."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1056 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1057 :group 'ps-print-color)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1058
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1059 (defcustom ps-default-fg '(0.0 0.0 0.0)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1060 "*RGB values of the default foreground color. Defaults to black."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1061 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1062 :group 'ps-print-color)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1063
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1064 (defcustom ps-default-bg '(1.0 1.0 1.0)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1065 "*RGB values of the default background color. Defaults to white."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1066 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1067 :group 'ps-print-color)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1068
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1069 (defcustom ps-auto-font-detect t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 "*Non-nil means automatically detect bold/italic face attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces',
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1072 and `ps-underlined-faces'."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1073 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1074 :group 'ps-print-font)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1075
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1076 (defcustom ps-bold-faces
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1077 (unless ps-print-color-p
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1078 '(font-lock-function-name-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1079 font-lock-builtin-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1080 font-lock-variable-name-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1081 font-lock-keyword-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1082 font-lock-warning-face))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 "*A list of the \(non-bold\) faces that should be printed in bold font.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1084 This applies to generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1085 :type '(repeat face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1086 :group 'ps-print-face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1087
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1088 (defcustom ps-italic-faces
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1089 (unless ps-print-color-p
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1090 '(font-lock-variable-name-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1091 font-lock-string-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1092 font-lock-comment-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1093 font-lock-warning-face))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 "*A list of the \(non-italic\) faces that should be printed in italic font.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1095 This applies to generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1096 :type '(repeat face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1097 :group 'ps-print-face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1098
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1099 (defcustom ps-underlined-faces
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1100 (unless ps-print-color-p
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1101 '(font-lock-function-name-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1102 font-lock-type-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1103 font-lock-reference-face
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1104 font-lock-warning-face))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 "*A list of the \(non-underlined\) faces that should be printed underlined.
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1106 This applies to generating Postscript."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1107 :type '(repeat face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1108 :group 'ps-print-face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1109
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1110 (defcustom ps-left-header
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (list 'ps-get-buffer-name 'ps-header-dirpart)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1112 "*The items to display (each on a line) on the left part of the page header.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 This applies to generating Postscript.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 The value should be a list of strings and symbols, each representing an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 entry in the PostScript array HeaderLinesLeft.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 Strings are inserted unchanged into the array; those representing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 PostScript string literals should be delimited with PostScript string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 delimiters '(' and ')'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 For symbols with bound functions, the function is called and should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 return a string to be inserted into the array. For symbols with bound
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 values, the value should be a string to be inserted into the array.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 In either case, function or variable, the string value has PostScript
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1126 string delimiters added to it."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1127 :type '(repeat (choice string symbol))
144
318232e2a3f0 Import from CVS: tag r20-2b6
cvs
parents: 124
diff changeset
1128 :group 'ps-print-header)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 (make-variable-buffer-local 'ps-left-header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1131 (defcustom ps-right-header
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1132 (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1133 "*The items to display (each on a line) on the right part of the page header.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 This applies to generating Postscript.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 See the variable `ps-left-header' for a description of the format of
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1137 this variable."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1138 :type '(repeat (choice string symbol))
144
318232e2a3f0 Import from CVS: tag r20-2b6
cvs
parents: 124
diff changeset
1139 :group 'ps-print-header)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 (make-variable-buffer-local 'ps-right-header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1142 (defcustom ps-razzle-dazzle t
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1143 "*Non-nil means report progress while formatting buffer."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1144 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1145 :group 'ps-print)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1147 (defvar ps-adobe-tag "%!PS-Adobe-3.0\n"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 "*Contains the header line identifying the output as PostScript.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 By default, `ps-adobe-tag' contains the standard identifier. Some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 printers require slightly different versions of this line.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1152 (defcustom ps-build-face-reference t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 "*Non-nil means build the reference face lists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 Ps-print sets this value to nil after it builds its internal reference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 lists of bold and italic faces. By settings its value back to t, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 can force ps-print to rebuild the lists the next time you invoke one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 of the ...-with-faces commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 You should set this value back to t after you change the attributes of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 any face, or create new faces. Most users shouldn't have to worry
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1162 about its setting, though."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1163 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1164 :group 'ps-print-face)
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1165
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1166 (defcustom ps-always-build-face-reference nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 "*Non-nil means always rebuild the reference face lists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 If this variable is non-nil, ps-print will rebuild its internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 reference lists of bold and italic faces *every* time one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 -with-faces commands is called. Most users shouldn't need to set this
124
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1172 variable."
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1173 :type 'boolean
9b50b4588a93 Import from CVS: tag r20-1b15
cvs
parents: 100
diff changeset
1174 :group 'ps-print-face)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 ;; User commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (defun ps-print-buffer (&optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 "Generate and print a PostScript image of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 When called with a numeric prefix argument (C-u), prompts the user for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 the name of a file to save the PostScript image in, instead of sending
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 it to the printer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 More specifically, the FILENAME argument is treated as follows: if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 is nil, send the image to the printer. If FILENAME is a string, save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 the PostScript image in a file with that name. If FILENAME is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 number, prompt the user for the name of the file to save in."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (interactive (list (ps-print-preprint current-prefix-arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (ps-generate (current-buffer) (point-min) (point-max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 'ps-generate-postscript)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (ps-do-despool filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (defun ps-print-buffer-with-faces (&optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 "Generate and print a PostScript image of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 Like `ps-print-buffer', but includes font, color, and underline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1202 information in the generated image. This command works only if you
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1203 are using a window system, so it has a way to determine color values."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (interactive (list (ps-print-preprint current-prefix-arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (ps-generate (current-buffer) (point-min) (point-max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 'ps-generate-postscript-with-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 (ps-do-despool filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 (defun ps-print-region (from to &optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 "Generate and print a PostScript image of the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 Like `ps-print-buffer', but prints just the current region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 (ps-generate (current-buffer) from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 'ps-generate-postscript)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (ps-do-despool filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (defun ps-print-region-with-faces (from to &optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 "Generate and print a PostScript image of the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 Like `ps-print-region', but includes font, color, and underline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1225 information in the generated image. This command works only if you
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1226 are using a window system, so it has a way to determine color values."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (ps-generate (current-buffer) from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 'ps-generate-postscript-with-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (ps-do-despool filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 (defun ps-spool-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 "Generate and spool a PostScript image of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 Like `ps-print-buffer' except that the PostScript image is saved in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 local buffer to be sent to the printer later.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 Use the command `ps-despool' to send the spooled images to the printer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (ps-generate (current-buffer) (point-min) (point-max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 'ps-generate-postscript))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (defun ps-spool-buffer-with-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 "Generate and spool a PostScript image of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 Like `ps-spool-buffer', but includes font, color, and underline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1250 information in the generated image. This command works only if you
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1251 are using a window system, so it has a way to determine color values.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 Use the command `ps-despool' to send the spooled images to the printer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 (ps-generate (current-buffer) (point-min) (point-max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 'ps-generate-postscript-with-faces))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (defun ps-spool-region (from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 "Generate a PostScript image of the region and spool locally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 Like `ps-spool-buffer', but spools just the current region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 Use the command `ps-despool' to send the spooled images to the printer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 (ps-generate (current-buffer) from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 'ps-generate-postscript))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (defun ps-spool-region-with-faces (from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 "Generate a PostScript image of the region and spool locally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 Like `ps-spool-region', but includes font, color, and underline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1275 information in the generated image. This command works only if you
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1276 are using a window system, so it has a way to determine color values.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 Use the command `ps-despool' to send the spooled images to the printer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 (ps-generate (current-buffer) from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 'ps-generate-postscript-with-faces))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (defun ps-despool (&optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 "Send the spooled PostScript to the printer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 When called with a numeric prefix argument (C-u), prompt the user for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 the name of a file to save the spooled PostScript in, instead of sending
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 it to the printer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 More specifically, the FILENAME argument is treated as follows: if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 is nil, send the image to the printer. If FILENAME is a string, save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 the PostScript image in a file with that name. If FILENAME is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 number, prompt the user for the name of the file to save in."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (interactive (list (ps-print-preprint current-prefix-arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (ps-do-despool filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1298 ;;;###autoload
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1299 (defun ps-line-lengths ()
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1300 "*Display the correspondence between a line length and a font size,
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1301 using the current ps-print setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1302 Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1303 (interactive)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1304 (ps-line-lengths-internal))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1305
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1306 ;;;###autoload
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1307 (defun ps-nb-pages-buffer (nb-lines)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1308 "*Display an approximate correspondence between a font size and the number
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1309 of pages the current buffer would require to print
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1310 using the current ps-print setup."
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1311 (interactive (list (count-lines (point-min) (point-max))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1312 (ps-nb-pages nb-lines))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1313
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1314 ;;;###autoload
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1315 (defun ps-nb-pages-region (nb-lines)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1316 "*Display an approximate correspondence between a font size and the number
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1317 of pages the current region would require to print
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1318 using the current ps-print setup."
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1319 (interactive (list (count-lines (mark) (point))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1320 (ps-nb-pages nb-lines))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1321
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1322 ;;;###autoload
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1323 (defun ps-setup ()
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1324 "*Return the current setup"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1325 (format "
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1326 (setq ps-print-color-p %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1327 ps-lpr-command \"%s\"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1328 ps-lpr-switches %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1329
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1330 ps-paper-type '%s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1331 ps-landscape-mode %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1332 ps-number-of-columns %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1333
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1334 ps-left-margin %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1335 ps-right-margin %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1336 ps-inter-column %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1337 ps-bottom-margin %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1338 ps-top-margin %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1339 ps-header-offset %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1340 ps-header-line-pad %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1341 ps-print-header %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1342 ps-print-header-frame %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1343 ps-header-lines %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1344 ps-show-n-of-n %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1345 ps-spool-duplex %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1346
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1347 ps-font-family '%s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1348 ps-font-size %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1349 ps-header-font-family '%s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1350 ps-header-font-size %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1351 ps-header-title-font-size %s)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1352 "
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1353 ps-print-color-p
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1354 ps-lpr-command
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1355 ps-lpr-switches
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1356 ps-paper-type
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1357 ps-landscape-mode
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1358 ps-number-of-columns
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1359 ps-left-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1360 ps-right-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1361 ps-inter-column
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1362 ps-bottom-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1363 ps-top-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1364 ps-header-offset
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1365 ps-header-line-pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1366 ps-print-header
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1367 ps-print-header-frame
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1368 ps-header-lines
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1369 ps-show-n-of-n
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1370 ps-spool-duplex
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1371 ps-font-family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1372 ps-font-size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1373 ps-header-font-family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1374 ps-header-font-size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1375 ps-header-title-font-size))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1376
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 ;; Utility functions and variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (defvar ps-print-emacs-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (cond ((string-match "XEmacs" emacs-version) 'xemacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 ((string-match "Lucid" emacs-version) 'lucid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 ((string-match "Epoch" emacs-version) 'epoch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (t 'emacs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (if (or (eq ps-print-emacs-type 'lucid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (eq ps-print-emacs-type 'xemacs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (if (< emacs-minor-version 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (setq ps-print-color-p nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (require 'faces)) ; face-font, face-underline-p,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 ; x-font-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1393 ;; Return t if the device (which can be changed during an emacs
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1394 ;; session) can handle colors.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1395 ;; This is function is not yet implemented for GNU emacs.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1396 (defun ps-color-device ()
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (if (and (eq ps-print-emacs-type 'xemacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (>= emacs-minor-version 12))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (require 'time-stamp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1404 (defvar ps-font nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1405 "Font family name for ordinary text, when generating Postscript.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1406
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1407 (defvar ps-font-bold nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1408 "Font family name for bold text, when generating Postscript.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1409
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1410 (defvar ps-font-italic nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1411 "Font family name for italic text, when generating Postscript.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1412
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1413 (defvar ps-font-bold-italic nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1414 "Font family name for bold italic text, when generating Postscript.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1415
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1416 (defvar ps-avg-char-width nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1417 "The average width, in points, of a character, for generating Postscript.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1418 This is the value that ps-print uses to determine the length,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1419 x-dimension, of the text it has printed, and thus affects the point at
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1420 which long lines wrap around.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1421
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1422 (defvar ps-space-width nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1423 "The width of a space character, for generating Postscript.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1424 This value is used in expanding tab characters.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1425
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1426 (defvar ps-line-height nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1427 "The height of a line, for generating Postscript.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1428 This is the value that ps-print uses to determine the height,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1429 y-dimension, of the lines of text it has printed, and thus affects the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1430 point at which page-breaks are placed.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1431 The line-height is *not* the same as the point size of the font.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1432
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1433 (defvar ps-print-prologue-1
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1434 "% ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 /ISOLatin1Encoding where { pop } {
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1436 % -- The ISO Latin-1 encoding vector isn't known, so define it.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1437 % -- The first half is the same as the standard encoding,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1438 % -- except for minus instead of hyphen at code 055.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 /ISOLatin1Encoding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 StandardEncoding 0 45 getinterval aload pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 /minus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 StandardEncoding 46 82 getinterval aload pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 %*** NOTE: the following are missing in the Adobe documentation,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 %*** but appear in the displayed table:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1446 % 0200 (128)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1451 % 0240 (160)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 /space /exclamdown /cent /sterling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 /currency /yen /brokenbar /section
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 /dieresis /copyright /ordfeminine /guillemotleft
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 /logicalnot /hyphen /registered /macron
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 /degree /plusminus /twosuperior /threesuperior
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 /acute /mu /paragraph /periodcentered
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 /cedilla /onesuperior /ordmasculine /guillemotright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 /onequarter /onehalf /threequarters /questiondown
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1460 % 0300 (192)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 /Agrave /Aacute /Acircumflex /Atilde
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 /Adieresis /Aring /AE /Ccedilla
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 /Egrave /Eacute /Ecircumflex /Edieresis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 /Igrave /Iacute /Icircumflex /Idieresis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 /Eth /Ntilde /Ograve /Oacute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 /Ocircumflex /Otilde /Odieresis /multiply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 /Oslash /Ugrave /Uacute /Ucircumflex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 /Udieresis /Yacute /Thorn /germandbls
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1469 % 0340 (224)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 /agrave /aacute /acircumflex /atilde
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 /adieresis /aring /ae /ccedilla
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 /egrave /eacute /ecircumflex /edieresis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 /igrave /iacute /icircumflex /idieresis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 /eth /ntilde /ograve /oacute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 /ocircumflex /otilde /odieresis /divide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 /oslash /ugrave /uacute /ucircumflex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 /udieresis /yacute /thorn /ydieresis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 256 packedarray def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 } ifelse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 /reencodeFontISO { %def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 dup
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1483 length 5 add dict % Make a new font (a new dict the same size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1484 % as the old one) with room for our new symbols.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1485
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1486 begin % Make the new font the current dictionary.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 { 1 index /FID ne
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 { def } { pop pop } ifelse
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1491 } forall % Copy each of the symbols from the old dictionary
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1492 % to the new one except for the font ID.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 /Encoding ISOLatin1Encoding def % Override the encoding with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 % the ISOLatin1 encoding.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 % Use the font's bounding box to determine the ascent, descent,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 % and overall height; don't forget that these values have to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 % transformed using the font's matrix.
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1500
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1501 % ^ (x2 y2)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1502 % | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1503 % | v
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1504 % | +----+ - -
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1505 % | | | ^
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1506 % | | | | Ascent (usually > 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1507 % | | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1508 % (0 0) -> +--+----+-------->
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1509 % | | |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1510 % | | v Descent (usually < 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1511 % (x1 y1) --> +----+ - -
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1512
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1513 FontBBox % -- x1 y1 x2 y2
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1514 FontMatrix transform /Ascent exch def pop
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
1515 FontMatrix transform /Descent exch def pop
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1516 /FontHeight Ascent Descent sub def % use `sub' because descent < 0
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1517
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1518 % Define these in case they're not in the FontInfo
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1519 % (also, here they're easier to get to.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1520 /UnderlinePosition 1 def
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 /UnderlineThickness 1 def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 % Get the underline position and thickness if they're defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 currentdict /FontInfo known {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 FontInfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 dup /UnderlinePosition known {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 dup /UnderlinePosition get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 0 exch FontMatrix transform exch pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 /UnderlinePosition exch def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 dup /UnderlineThickness known {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 /UnderlineThickness get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 0 exch FontMatrix transform exch pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 /UnderlineThickness exch def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1541 currentdict % Leave the new font on the stack
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1542 end % Stop using the font as the current dictionary.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1543 definefont % Put the font into the font dictionary
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1544 pop % Discard the returned font.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 } bind def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1547 /DefFont { % Font definition
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 findfont exch scalefont reencodeFontISO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1551 /F { % Font selection
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 findfont
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1553 dup /Ascent get /Ascent exch def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1554 dup /Descent get /Descent exch def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1555 dup /FontHeight get /FontHeight exch def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1556 dup /UnderlinePosition get /UnderlinePosition exch def
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 dup /UnderlineThickness get /UnderlineThickness exch def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 setfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 /FG /setrgbcolor load def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 /bg false def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 /BG {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 dup /bg exch def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 { mark 4 1 roll ] /bgcolor exch def } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1569 % B width C
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1570 % +-----------+
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1571 % | Ascent (usually > 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1572 % A + +
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1573 % | Descent (usually < 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1574 % +-----------+
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1575 % E width D
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1576
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 /dobackground { % width --
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1578 currentpoint % -- width x y
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 newpath
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1581 moveto % A (x y)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1582 0 Ascent rmoveto % B
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1583 dup 0 rlineto % C
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1584 0 Descent Ascent sub rlineto % D
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1585 neg 0 rlineto % E
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 closepath
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 bgcolor aload pop setrgbcolor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 /dobackgroundstring { % string --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 stringwidth pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 dobackground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 /dounderline { % fromx fromy --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 currentpoint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 UnderlineThickness setlinewidth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 4 2 roll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 UnderlinePosition add moveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 UnderlinePosition add lineto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 stroke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1608 /eolbg { % dobackground until right margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1609 PrintWidth % -- x-eol
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1610 currentpoint pop % -- cur-x
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1611 sub % -- width until eol
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1612 dobackground
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1615 /eolul { % idem for underline
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1616 PrintWidth % -- x-eol
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1617 currentpoint exch pop % -- x-eol cur-y
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1618 dounderline
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 /SL { % Soft Linefeed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 bg { eolbg } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 ul { eolul } if
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1624 0 currentpoint exch pop LineHeight sub moveto
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 /HL /SL load def % Hard Linefeed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 /sp1 { currentpoint 3 -1 roll } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 % Some debug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 /dcp { currentpoint exch 40 string cvs print (, ) print = } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 /dp { print 2 copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 exch 40 string cvs print (, ) print = } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 /S {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 bg { dup dobackgroundstring } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 ul { sp1 } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 ul { dounderline } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 /W {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 ul { sp1 } if
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1645 ( ) stringwidth % Get the width of a space in the current font.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1646 pop % Discard the Y component.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1647 mul % Multiply the width of a space
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1648 % by the number of spaces to plot
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 bg { dup dobackground } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 0 rmoveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 ul { dounderline } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1654 /BeginDoc {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1655 % ---- save the state of the document (useful for ghostscript!)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1656 /docState save def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1657 % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1658 /JackGhostscript where {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1659 pop 1 27.7 29.7 div scale
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1660 } if
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1661 LandscapeMode {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1662 % ---- translate to bottom-right corner of Portrait page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1663 LandscapePageHeight 0 translate
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1664 90 rotate
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1665 } if
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1666 /ColumnWidth PrintWidth InterColumn add def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1667 % ---- translate to lower left corner of TEXT
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1668 LeftMargin BottomMargin translate
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1669 % ---- define where printing will start
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1670 /f0 F % this installs Ascent
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1671 /PrintStartY PrintHeight Ascent sub def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1672 /ColumnIndex 1 def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1673 } def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1674
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1675 /EndDoc {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1676 % ---- on last page but not last column, spit out the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1677 ColumnIndex 1 eq not { showpage } if
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1678 % ---- restore the state of the document (useful for ghostscript!)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1679 docState restore
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1680 } def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1681
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 /BeginDSCPage {
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1683 % ---- when 1st column, save the state of the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1684 ColumnIndex 1 eq { /pageState save def } if
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1685 % ---- save the state of the column
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1686 /columnState save def
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 /BeginPage {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 PrintHeader {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 PrintHeaderFrame { HeaderFrame } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 HeaderText
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 } if
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1694 0 PrintStartY moveto % move to where printing will start
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 /EndPage {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 bg { eolbg } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 ul { eolul } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 /EndDSCPage {
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1703 ColumnIndex NumberOfColumns eq {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1704 % ---- on last column, spit out the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1705 showpage
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1706 % ---- restore the state of the page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1707 pageState restore
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1708 /ColumnIndex 1 def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1709 } { % else
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1710 % ---- restore the state of the current column
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1711 columnState restore
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1712 % ---- and translate to the next column
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1713 ColumnWidth 0 translate
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1714 /ColumnIndex ColumnIndex 1 add def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1715 } ifelse
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 /ul false def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 /UL { /ul exch def } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1722 /SetHeaderLines { % nb-lines --
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 /HeaderLines exch def
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1724 % ---- bottom up
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1725 HeaderPad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1726 HeaderLines 1 sub HeaderLineHeight mul add
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1727 HeaderTitleLineHeight add
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1728 HeaderPad add
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1729 /HeaderHeight exch def
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1732 % |---------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1733 % | tm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1734 % |---------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1735 % | header |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1736 % |-+-------| <-- (x y)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1737 % | ho |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1738 % |---------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1739 % | text |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1740 % |-+-------| <-- (0 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1741 % | bm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1742 % |---------|
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1743
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1744 /HeaderFrameStart { % -- x y
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1745 0 PrintHeight HeaderOffset add
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 /HeaderFramePath {
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1749 PrintWidth 0 rlineto
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1750 0 HeaderHeight rlineto
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1751 PrintWidth neg 0 rlineto
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1752 0 HeaderHeight neg rlineto
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 /HeaderFrame {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 0.4 setlinewidth
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1758 % ---- fill a black rectangle (the shadow of the next one)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 HeaderFrameStart moveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 1 -1 rmoveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 HeaderFramePath
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 0 setgray fill
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1763 % ---- do the next rectangle ...
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 HeaderFrameStart moveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 HeaderFramePath
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1766 gsave 0.9 setgray fill grestore % filled with grey
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1767 gsave 0 setgray stroke grestore % drawn with black
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 /HeaderStart {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 HeaderFrameStart
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1773 exch HeaderPad add exch % horizontal pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1774 % ---- bottom up
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1775 HeaderPad add % vertical pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1776 HeaderDescent sub
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1777 HeaderLineHeight HeaderLines 1 sub mul add
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 /strcat {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 dup length 3 -1 roll dup length dup 4 -1 roll add string dup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 0 5 -1 roll putinterval
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 dup 4 2 roll exch putinterval
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 /pagenumberstring {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 PageNumber 32 string cvs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 ShowNofN {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 (/) strcat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 PageCount 32 string cvs strcat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 /HeaderText {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 HeaderStart moveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1797 HeaderLinesRight HeaderLinesLeft % -- rightLines leftLines
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1798
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1799 % ---- hack: `PN 1 and' == `PN 2 modulo'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1800
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1801 % ---- if duplex and even page number, then exchange left and right
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 Duplex PageNumber 1 and 0 eq and { exch } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1804 { % ---- process the left lines
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 aload pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 exch F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 dup xcheck { exec } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 0 HeaderLineHeight neg rmoveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 } forall
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 HeaderStart moveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1816 { % ---- process the right lines
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 aload pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 exch F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 dup xcheck { exec } if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 dup stringwidth pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 PrintWidth exch sub HeaderPad 2 mul sub 0 rmoveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 0 HeaderLineHeight neg rmoveto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 } forall
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 /ReportFontInfo {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 2 copy
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1831 /t0 3 1 roll DefFont
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 /t0 F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 /lh FontHeight def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 /sw ( ) stringwidth pop def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 /aw (01234567890abcdefghijklmnopqrstuvwxyz) dup length exch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 stringwidth pop exch div def
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1837 /t1 12 /Helvetica-Oblique DefFont
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 /t1 F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 gsave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 (For ) show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 128 string cvs show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 ( ) show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 32 string cvs show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 ( point, the line height is ) show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 lh 32 string cvs show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 (, the space width is ) show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 sw 32 string cvs show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (,) show
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 grestore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 0 FontHeight neg rmoveto
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1851 gsave
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1852 (and a crude estimate of average character width is ) show
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1853 aw 32 string cvs show
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1854 (.) show
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1855 grestore
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1856 0 FontHeight neg rmoveto
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1857 } def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1858
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1859 /cm { % cm to point
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1860 72 mul 2.54 div
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1861 } def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1862
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1863 /ReportAllFontInfo {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1864 FontDirectory
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1865 { % key = font name value = font dictionary
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1866 pop 10 exch ReportFontInfo
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1867 } forall
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 } def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1870 % 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1871 % 3 cm 20 cm moveto ReportAllFontInfo showpage
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1872
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1873 ")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1874
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1875 (defvar ps-print-prologue-2
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1876 "
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1877 % ---- These lines must be kept together because...
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1878
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1879 /h0 F
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1880 /HeaderTitleLineHeight FontHeight def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1881
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1882 /h1 F
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1883 /HeaderLineHeight FontHeight def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1884 /HeaderDescent Descent def
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1885
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1886 % ---- ...because `F' has a side-effect on `FontHeight' and `Descent'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1887
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 ;; Start Editing Here:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 (defvar ps-source-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (defvar ps-spool-buffer-name "*PostScript*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (defvar ps-spool-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 (defvar ps-output-head nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 (defvar ps-output-tail nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 (defvar ps-page-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (defvar ps-showpage-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 (defvar ps-current-font 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (defvar ps-current-underline-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 (defvar ps-default-color (if ps-print-color-p ps-default-fg)) ; black
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 (defvar ps-current-color ps-default-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 (defvar ps-current-bg nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 (defvar ps-razchunk 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1910 (defvar ps-color-format
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1911 (if (eq ps-print-emacs-type 'emacs)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1912
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1913 ;;Emacs understands the %f format; we'll
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1914 ;;use it to limit color RGB values to
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1915 ;;three decimals to cut down some on the
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1916 ;;size of the PostScript output.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1917 "%0.3f %0.3f %0.3f"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1918
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1919 ;; Lucid emacsen will have to make do with
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1920 ;; %s (princ) for floats.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1921 "%s %s %s"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 ;; These values determine how much print-height to deduct when headers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 ;; are turned on. This is a pretty clumsy way of handling it, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 ;; it'll do for now.
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1926
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1927 (defvar ps-header-font)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1928 (defvar ps-header-title-font)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1929
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1930 (defvar ps-header-line-height)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1931 (defvar ps-header-title-line-height)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1932 (defvar ps-header-pad 0
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1933 "Vertical and horizontal space in points (1/72 inch) between the header frame
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1934 and the text it contains.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1935
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1936 ;; Define accessors to the dimensions list.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1937
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1938 (defmacro ps-page-dimensions-get-width (dims) `(nth 0 ,dims))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1939 (defmacro ps-page-dimensions-get-height (dims) `(nth 1 ,dims))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1940
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1941 (defvar ps-landscape-page-height)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1942
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (defvar ps-print-width nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (defvar ps-print-height nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 (defvar ps-height-remaining)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (defvar ps-width-remaining)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 (defvar ps-ref-bold-faces nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 (defvar ps-ref-italic-faces nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 (defvar ps-ref-underlined-faces nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1953 (defvar ps-print-color-scale nil)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1954
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 ;; Internal functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1958 (defun ps-line-lengths-internal ()
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1959 "Display the correspondence between a line length and a font size,
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1960 using the current ps-print setup.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1961 Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1962 (let ((buf (get-buffer-create "*Line-lengths*"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1963 (ifs ps-font-size) ; initial font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1964 (icw ps-avg-char-width) ; initial character width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1965 (print-width (progn (ps-get-page-dimensions)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1966 ps-print-width))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1967 (ps-setup (ps-setup)) ; setup for the current buffer
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1968 (fs-min 5) ; minimum font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1969 cw-min ; minimum character width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1970 nb-cpl-max ; maximum nb of characters per line
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1971 (fs-max 14) ; maximum font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1972 cw-max ; maximum character width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1973 nb-cpl-min ; minimum nb of characters per line
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1974 fs ; current font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1975 cw ; current character width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1976 nb-cpl ; current nb of characters per line
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1977 )
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1978 (setq cw-min (/ (* icw fs-min) ifs)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1979 nb-cpl-max (floor (/ print-width cw-min))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1980 cw-max (/ (* icw fs-max) ifs)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1981 nb-cpl-min (floor (/ print-width cw-max)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1982 (setq nb-cpl nb-cpl-min)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1983 (set-buffer buf)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1984 (goto-char (point-max))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1985 (if (not (bolp)) (insert "\n"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1986 (insert ps-setup)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1987 (insert "nb char per line / font size\n")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1988 (while (<= nb-cpl nb-cpl-max)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1989 (setq cw (/ print-width (float nb-cpl))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1990 fs (/ (* ifs cw) icw))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1991 (insert (format "%3s %s\n" nb-cpl fs))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1992 (setq nb-cpl (1+ nb-cpl)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1993 (insert "\n")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1994 (display-buffer buf 'not-this-window)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1995
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1996 (defun ps-nb-pages (nb-lines)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
1997 "Display an approximate correspondence between a font size and the number
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1998 of pages the number of lines would require to print
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
1999 using the current ps-print setup."
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2000 (let ((buf (get-buffer-create "*Nb-Pages*"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2001 (ifs ps-font-size) ; initial font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2002 (ilh ps-line-height) ; initial line height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2003 (page-height (progn (ps-get-page-dimensions)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2004 ps-print-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2005 (ps-setup (ps-setup)) ; setup for the current buffer
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2006 (fs-min 4) ; minimum font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2007 lh-min ; minimum line height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2008 nb-lpp-max ; maximum nb of lines per page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2009 nb-page-min ; minimum nb of pages
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2010 (fs-max 14) ; maximum font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2011 lh-max ; maximum line height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2012 nb-lpp-min ; minimum nb of lines per page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2013 nb-page-max ; maximum nb of pages
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2014 fs ; current font size
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2015 lh ; current line height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2016 nb-lpp ; current nb of lines per page
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2017 nb-page ; current nb of pages
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2018 )
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2019 (setq lh-min (/ (* ilh fs-min) ifs)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2020 nb-lpp-max (floor (/ page-height lh-min))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2021 nb-page-min (ceiling (/ (float nb-lines) nb-lpp-max))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2022 lh-max (/ (* ilh fs-max) ifs)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2023 nb-lpp-min (floor (/ page-height lh-max))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2024 nb-page-max (ceiling (/ (float nb-lines) nb-lpp-min)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2025 (setq nb-page nb-page-min)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2026 (set-buffer buf)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2027 (goto-char (point-max))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2028 (if (not (bolp)) (insert "\n"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2029 (insert ps-setup)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2030 (insert (format "%d lines\n" nb-lines))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2031 (insert "nb page / font size\n")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2032 (while (<= nb-page nb-page-max)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2033 (setq nb-lpp (ceiling (/ nb-lines (float nb-page)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2034 lh (/ page-height nb-lpp)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2035 fs (/ (* ifs lh) ilh))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2036 (insert (format "%s %s\n" nb-page fs))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2037 (setq nb-page (1+ nb-page)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2038 (insert "\n")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2039 (display-buffer buf 'not-this-window)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2040
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2041 (defun ps-select-font ()
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2042 "Choose the font name and size (scaling data)."
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2043 (let ((assoc (assq ps-font-family ps-font-info-database))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2044 l fn fb fi bi sz lh sw aw)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2045 (if (null assoc)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2046 (error "Don't have data to scale font %s. Known fonts families are %s"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2047 ps-font-family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2048 (mapcar 'car ps-font-info-database)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2049 (setq l (cdr assoc)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2050 fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2051 fb (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2052 fi (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2053 bi (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2054 sz (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2055 lh (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2056 sw (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2057 aw (prog1 (car l) (setq l (cdr l))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2058
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2059 (setq ps-font fn)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2060 (setq ps-font-bold fb)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2061 (setq ps-font-italic fi)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2062 (setq ps-font-bold-italic bi)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2063 ;; These data just need to be rescaled:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2064 (setq ps-line-height (/ (* lh ps-font-size) sz))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2065 (setq ps-space-width (/ (* sw ps-font-size) sz))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2066 (setq ps-avg-char-width (/ (* aw ps-font-size) sz))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2067 ps-font-family))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2068
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2069 (defun ps-select-header-font ()
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2070 "Choose the font name and size (scaling data) for the header."
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2071 (let ((assoc (assq ps-header-font-family ps-font-info-database))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2072 l fn fb fi bi sz lh sw aw)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2073 (if (null assoc)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2074 (error "Don't have data to scale font %s. Known fonts families are %s"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2075 ps-font-family
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2076 (mapcar 'car ps-font-info-database)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2077 (setq l (cdr assoc)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2078 fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2079 fb (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2080 fi (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2081 bi (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2082 sz (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2083 lh (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2084 sw (prog1 (car l) (setq l (cdr l)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2085 aw (prog1 (car l) (setq l (cdr l))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2086
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2087 ;; Font name
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2088 (setq ps-header-font fn)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2089 (setq ps-header-title-font fb)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2090 ;; Line height: These data just need to be rescaled:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2091 (setq ps-header-title-line-height (/ (* lh ps-header-title-font-size) sz))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2092 (setq ps-header-line-height (/ (* lh ps-header-font-size) sz))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2093 ps-header-font-family))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2094
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 (defun ps-get-page-dimensions ()
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2096 (let ((page-dimensions (cdr (assq ps-paper-type ps-page-dimensions-database)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2097 page-width page-height)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2098 (cond
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2099 ((null page-dimensions)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2100 (error "`ps-paper-type' must be one of:\n%s"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2101 (mapcar 'car ps-page-dimensions-database)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2102 ((< ps-number-of-columns 1)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2103 (error "The number of columns %d should not be negative")))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2104
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2105 (ps-select-font)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2106 (ps-select-header-font)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2107
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2108 (setq page-width (ps-page-dimensions-get-width page-dimensions)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2109 page-height (ps-page-dimensions-get-height page-dimensions))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2110
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2111 ;; Landscape mode
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2112 (if ps-landscape-mode
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2113 ;; exchange width and height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2114 (setq page-width (prog1 page-height (setq page-height page-width))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2115
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2116 ;; It is used to get the lower right corner (only in landscape mode)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2117 (setq ps-landscape-page-height page-height)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2118
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2119 ;; | lm | text | ic | text | ic | text | rm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2120 ;; page-width == lm + n * pw + (n - 1) * ic + rm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2121 ;; => pw == (page-width - lm -rm - (n - 1) * ic) / n
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2122 (setq ps-print-width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2123 (/ (- page-width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2124 ps-left-margin ps-right-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2125 (* (1- ps-number-of-columns) ps-inter-column))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2126 ps-number-of-columns))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2127 (if (<= ps-print-width 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2128 (error "Bad horizontal layout:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2129 page-width == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2130 ps-left-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2131 ps-right-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2132 ps-inter-column == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2133 ps-number-of-columns == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2134 | lm | text | ic | text | ic | text | rm |
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2135 page-width == lm + n * print-width + (n - 1) * ic + rm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2136 => print-width == %d !"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2137 page-width
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2138 ps-left-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2139 ps-right-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2140 ps-inter-column
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2141 ps-number-of-columns
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2142 ps-print-width))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2143
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2144 (setq ps-print-height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2145 (- page-height ps-bottom-margin ps-top-margin))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2146 (if (<= ps-print-height 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2147 (error "Bad vertical layout:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2148 ps-top-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2149 ps-bottom-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2150 page-height == bm + print-height + tm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2151 => print-height == %d !"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2152 ps-top-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2153 ps-bottom-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2154 ps-print-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2155 ;; If headers are turned on, deduct the height of the header from
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2156 ;; the print height.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2157 (cond
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2158 (ps-print-header
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2159 (setq ps-header-pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2160 (* ps-header-line-pad ps-header-title-line-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2161 (setq ps-print-height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2162 (- ps-print-height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2163 ps-header-offset
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2164 ps-header-pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2165 ps-header-title-line-height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2166 (* ps-header-line-height (- ps-header-lines 1))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2167 ps-header-pad))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2168 (if (<= ps-print-height 0)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2169 (error "Bad vertical layout:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2170 ps-top-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2171 ps-bottom-margin == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2172 ps-header-offset == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2173 ps-header-pad == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2174 header-height == %s
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2175 page-height == bm + print-height + tm - ho - hh
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2176 => print-height == %d !"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2177 ps-top-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2178 ps-bottom-margin
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2179 ps-header-offset
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2180 ps-header-pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2181 (+ ps-header-pad
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2182 ps-header-title-line-height
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2183 (* ps-header-line-height (- ps-header-lines 1))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2184 ps-header-pad)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2185 ps-print-height))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (defun ps-print-preprint (&optional filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 (if (and filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 (or (numberp filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 (listp filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 (let* ((name (concat (buffer-name) ".ps"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 (prompt (format "Save PostScript to file: (default %s) "
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2193 name))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2194 (res (read-file-name prompt default-directory name nil)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2195 (if (file-directory-p res)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2196 (expand-file-name name (file-name-as-directory res))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2197 res))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 ;; The following functions implement a simple list-buffering scheme so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 ;; that ps-print doesn't have to repeatedly switch between buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 ;; while spooling. The functions ps-output and ps-output-string build
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 ;; up the lists; the function ps-flush-output takes the lists and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 ;; insert its contents into the spool buffer (*PostScript*).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 (defun ps-output-string-prim (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 (insert "(") ;insert start-string delimiter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 (save-excursion ;insert string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 (insert string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 ;; Find and quote special characters as necessary for PS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 (while (re-search-forward "[()\\]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 (insert "\\")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 (insert ")")) ;insert end-string delimiter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 (defun ps-init-output-queue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (setq ps-output-head (list ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 (setq ps-output-tail ps-output-head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (defun ps-output (&rest args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 (setcdr ps-output-tail args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 (while (cdr ps-output-tail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 (setq ps-output-tail (cdr ps-output-tail))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 (defun ps-output-string (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 (ps-output t string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 (defun ps-flush-output ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 (while ps-output-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 (let ((it (car ps-output-head)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 (if (not (eq t it))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 (insert it)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 (setq ps-output-head (cdr ps-output-head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 (ps-output-string-prim (car ps-output-head))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 (setq ps-output-head (cdr ps-output-head))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 (ps-init-output-queue))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 (defun ps-insert-file (fname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 (ps-flush-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 ;; Check to see that the file exists and is readable; if not, throw
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2248 ;; an error.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 (if (not (file-readable-p fname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 (error "Could not read file `%s'" fname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 (insert-file fname)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 ;; These functions insert the arrays that define the contents of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 ;; headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 (defun ps-generate-header-line (fonttag &optional content)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 (ps-output " [ " fonttag " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 ;; Literal strings should be output as is -- the string must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 ;; contain its own PS string delimiters, '(' and ')', if necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 ((stringp content)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 (ps-output content))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 ;; Functions are called -- they should return strings; they will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 ;; inserted as strings and the PS string delimiters added.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 ((and (symbolp content) (fboundp content))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 (ps-output-string (funcall content)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 ;; Variables will have their contents inserted. They should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 ;; contain strings, and will be inserted as strings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 ((and (symbolp content) (boundp content))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 (ps-output-string (symbol-value content)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 ;; Anything else will get turned into an empty string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 (ps-output-string "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (ps-output " ]\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (defun ps-generate-header (name contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 (ps-output "/" name " [\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 (if (> ps-header-lines 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 (let ((count 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 (ps-generate-header-line "/h0" (car contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 (while (and (< count ps-header-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 (setq contents (cdr contents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 (ps-generate-header-line "/h1" (car contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 (setq count (+ count 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 (ps-output "] def\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 (defun ps-output-boolean (name bool)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (ps-output (format "/%s %s def\n" name (if bool "true" "false"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 (defun ps-begin-file ()
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2298 (ps-get-page-dimensions)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 (setq ps-showpage-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 (ps-output ps-adobe-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 (ps-output "%%Title: " (buffer-name) "\n") ;Take job name from name of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 ;first buffer printed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 (ps-output "%%Creator: " (user-full-name) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 (ps-output "%%CreationDate: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 (time-stamp-hh:mm:ss) " " (time-stamp-mon-dd-yyyy) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 (ps-output "%%Pages: (atend)\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 (ps-output "%%EndComments\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2310 (ps-output "%%BeginProlog\n")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2311 (ps-output-boolean "LandscapeMode" ps-landscape-mode)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2312 (ps-output (format "/NumberOfColumns %d def\n" ps-number-of-columns))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2313
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2314 (ps-output (format "/LandscapePageHeight %s def\n" ps-landscape-page-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2315 (ps-output (format "/PrintWidth %s def\n" ps-print-width))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2316 (ps-output (format "/PrintHeight %s def\n" ps-print-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2317
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2318 (ps-output (format "/LeftMargin %s def\n" ps-left-margin))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2319 (ps-output (format "/RightMargin %s def\n" ps-right-margin)) ; not used
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2320 (ps-output (format "/InterColumn %s def\n" ps-inter-column))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2321
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2322 (ps-output (format "/BottomMargin %s def\n" ps-bottom-margin))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2323 (ps-output (format "/TopMargin %s def\n" ps-top-margin)) ; not used
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2324 (ps-output (format "/HeaderOffset %s def\n" ps-header-offset))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2325 (ps-output (format "/HeaderPad %s def\n" ps-header-pad))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2326
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2327 (ps-output-boolean "PrintHeader" ps-print-header)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 24
diff changeset
2328 (ps-output-boolean "PrintHeaderFrame" ps-print-header-frame)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2329 (ps-output-boolean "ShowNofN" ps-show-n-of-n)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2330 (ps-output-boolean "Duplex" ps-spool-duplex)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2331
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2332 (ps-output (format "/LineHeight %s def\n" ps-line-height))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2333
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2334 (ps-output ps-print-prologue-1)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2335 (ps-output "%%EndProlog\n\n")
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2336
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2337
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2338 (ps-output "%%BeginSetup\n")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2339
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2340 ;; Header fonts
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2341 (ps-output ; /h0 14 /Helvetica-Bold Font
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2342 (format "/h0 %s /%s DefFont\n" ps-header-title-font-size ps-header-title-font))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2343 (ps-output ; /h1 12 /Helvetica Font
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2344 (format "/h1 %s /%s DefFont\n" ps-header-font-size ps-header-font))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2345
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2346 (ps-output ps-print-prologue-2)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2347
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2348 ;; Text fonts
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2349 (ps-output (format "/f0 %s /%s DefFont\n" ps-font-size ps-font))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2350 (ps-output (format "/f1 %s /%s DefFont\n" ps-font-size ps-font-bold))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2351 (ps-output (format "/f2 %s /%s DefFont\n" ps-font-size ps-font-italic))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2352 (ps-output (format "/f3 %s /%s DefFont\n" ps-font-size ps-font-bold-italic))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2353
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2354 (ps-output "\nBeginDoc\n\n")
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2355 (ps-output "%%EndSetup\n")
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2356 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 (defun ps-header-dirpart ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 (let ((fname (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 (if fname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 (if (string-equal (buffer-name) (file-name-nondirectory fname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (file-name-directory fname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 fname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 (defun ps-get-buffer-name ()
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2367 (cond
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2368 ;; Indulge Jim this little easter egg:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2369 ((string= (buffer-name) "ps-print.el")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2370 "Hey, Cool! It's ps-print.el!!!")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2371 ;; Indulge Jack this other little easter egg:
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2372 ((string= (buffer-name) "sokoban.el")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2373 "Super! C'est sokoban.el!")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2374 (t (buffer-name))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (defun ps-begin-job ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (setq ps-page-count 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (defun ps-end-file ()
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2380 (ps-output "\n\n%%Trailer\n")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2381 (ps-output (format "%%%%Pages: %d\n" (1+ (/ (1- ps-page-count)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2382 ps-number-of-columns))))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2383 (ps-output "EndDoc\n")
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2384 (ps-output "%%EOF\n"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 (defun ps-next-page ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 (ps-end-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 (ps-flush-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 (ps-begin-page))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 (defun ps-begin-page (&optional dummypage)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 (ps-get-page-dimensions)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2393 (setq ps-width-remaining ps-print-width)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 (setq ps-height-remaining ps-print-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2396 ;; Print only when a new real page begins.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2397 (when (zerop (mod ps-page-count ps-number-of-columns))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2398 (ps-output (format "\n%%%%Page: %d %d\n"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2399 (1+ (/ ps-page-count ps-number-of-columns))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2400 (1+ (/ ps-page-count ps-number-of-columns)))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2401
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 (ps-output "BeginDSCPage\n")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2403 (ps-output (format "/PageNumber %d def\n" (incf ps-page-count)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 (ps-output "/PageCount 0 def\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2406 (when ps-print-header
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2407 (ps-generate-header "HeaderLinesLeft" ps-left-header)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2408 (ps-generate-header "HeaderLinesRight" ps-right-header)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2409 (ps-output (format "%d SetHeaderLines\n" ps-header-lines)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 (ps-output "BeginPage\n")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2412 (ps-set-font ps-current-font)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2413 (ps-set-bg ps-current-bg)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2414 (ps-set-color ps-current-color)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 (ps-set-underline ps-current-underline-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 (defun ps-end-page ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 (setq ps-showpage-count (+ 1 ps-showpage-count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 (ps-output "EndPage\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 (ps-output "EndDSCPage\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (defun ps-dummy-page ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (setq ps-showpage-count (+ 1 ps-showpage-count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 (ps-output "%%Page: " (format "- %d\n" ps-showpage-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 "BeginDSCPage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 /PrintHeader false def
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 BeginPage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 EndPage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 EndDSCPage\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 (defun ps-next-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 (if (< ps-height-remaining ps-line-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 (ps-next-page)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2434 (setq ps-width-remaining ps-print-width)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 (setq ps-height-remaining (- ps-height-remaining ps-line-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 (ps-hard-lf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 (defun ps-continue-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 (if (< ps-height-remaining ps-line-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 (ps-next-page)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2441 (setq ps-width-remaining ps-print-width)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 (setq ps-height-remaining (- ps-height-remaining ps-line-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 (ps-soft-lf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2445 ;; [jack] Why hard and soft ?
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2446
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 (defun ps-hard-lf ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 (ps-output "HL\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 (defun ps-soft-lf ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 (ps-output "SL\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 (defun ps-find-wrappoint (from to char-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 (let ((avail (truncate (/ ps-width-remaining char-width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 (todo (- to from)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 (if (< todo avail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 (cons to (* todo char-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (cons (+ from avail) ps-width-remaining))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 (defun ps-basic-plot-string (from to &optional bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 (let* ((wrappoint (ps-find-wrappoint from to ps-avg-char-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 (to (car wrappoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 (string (buffer-substring from to)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (ps-output-string string)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2465 (ps-output " S\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 wrappoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 (defun ps-basic-plot-whitespace (from to &optional bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 (let* ((wrappoint (ps-find-wrappoint from to ps-space-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (to (car wrappoint)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 (ps-output (format "%d W\n" (- to from)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 wrappoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 (defun ps-plot (plotfunc from to &optional bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 (while (< from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 (let* ((wrappoint (funcall plotfunc from to bg-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (plotted-to (car wrappoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 (plotted-width (cdr wrappoint)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 (setq from plotted-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 (setq ps-width-remaining (- ps-width-remaining plotted-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 (if (< from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 (ps-continue-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 (let* ((q-todo (- (point-max) (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 (q-done (- (point) (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (chunkfrac (/ q-todo 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (chunksize (if (> chunkfrac 1000) 1000 chunkfrac)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (if (> (- q-done ps-razchunk) chunksize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 (let (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (setq ps-razchunk q-done)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 (setq foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (if (< q-todo 100)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 (/ (* 100 q-done) q-todo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 (/ q-done (/ q-todo 100))))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2496 (message "Formatting...%3d%%" foo))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 (defun ps-set-font (font)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (setq ps-current-font font)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (ps-output (format "/f%d F\n" ps-current-font)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 (defun ps-set-bg (color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (if (setq ps-current-bg color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 (ps-output (format ps-color-format (nth 0 color) (nth 1 color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 (nth 2 color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 " true BG\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (ps-output "false BG\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (defun ps-set-color (color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 (if (setq ps-current-color color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 (setq ps-current-color ps-default-fg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (ps-output (format ps-color-format (nth 0 ps-current-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 (nth 1 ps-current-color) (nth 2 ps-current-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 " FG\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (defun ps-set-underline (underline-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 (ps-output (if underline-p "true" "false") " UL\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (setq ps-current-underline-p underline-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 (defun ps-plot-region (from to font fg-color &optional bg-color underline-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (if (not (equal font ps-current-font))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 (ps-set-font font))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 ;; Specify a foreground color only if one's specified and it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 ;; different than the current.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 (if (not (equal fg-color ps-current-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (ps-set-color fg-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 (if (not (equal bg-color ps-current-bg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 (ps-set-bg bg-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 ;; Toggle underlining if different.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 (if (not (equal underline-p ps-current-underline-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 (ps-set-underline underline-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 ;; Starting at the beginning of the specified region...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 (goto-char from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 ;; ...break the region up into chunks separated by tabs, linefeeds,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 ;; and pagefeeds, and plot each chunk.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (while (< from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (if (re-search-forward "[\t\n\f]" to t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (let ((match (char-after (match-beginning 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 ((= match ?\t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 (let ((linestart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 (save-excursion (beginning-of-line) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (ps-plot 'ps-basic-plot-string from (- (point) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (setq from (+ linestart (current-column)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 (if (re-search-forward "[ \t]+" to t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 (ps-plot 'ps-basic-plot-whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 from (+ linestart (current-column))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 bg-color))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 ((= match ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 (ps-plot 'ps-basic-plot-string from (- (point) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 (ps-next-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 ((= match ?\f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 (ps-plot 'ps-basic-plot-string from (- (point) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (ps-next-page)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (setq from (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 (ps-plot 'ps-basic-plot-string from to bg-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 (setq from to)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 (defun ps-color-value (x-color-value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 (/ x-color-value ps-print-color-scale))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (defun ps-color-values (x-color)
96
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2579 (cond ((fboundp 'color-instance-rgb-components)
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2580 (if (ps-color-device)
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2581 (color-instance-rgb-components
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2582 (if (color-instance-p x-color) x-color
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2583 (if (color-specifier-p x-color)
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2584 (make-color-instance (color-name x-color))
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2585 (make-color-instance x-color))))
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2586 (error "No available function to determine X color values.")))
dbb370e3c29e Import from CVS: tag r20-0final
cvs
parents: 88
diff changeset
2587 ((fboundp 'x-color-values)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 (x-color-values x-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (t (error "No available function to determine X color values."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 (defun ps-face-attributes (face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592 (let ((differs (face-differs-from-default-p face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (list (memq face ps-ref-bold-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 (memq face ps-ref-italic-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 (memq face ps-ref-underlined-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 (and differs (face-foreground face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 (and differs (face-background face)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 (defun ps-face-attribute-list (face-or-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 (if (listp face-or-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 (let (bold-p italic-p underline-p foreground background face-attr face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 (while face-or-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 (setq face (car face-or-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 (setq face-attr (ps-face-attributes face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 (setq bold-p (or bold-p (nth 0 face-attr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 (setq italic-p (or italic-p (nth 1 face-attr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 (setq underline-p (or underline-p (nth 2 face-attr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 (if foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 (setq foreground (nth 3 face-attr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 (if background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 (setq background (nth 4 face-attr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 (setq face-or-list (cdr face-or-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 (list bold-p italic-p underline-p foreground background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 (ps-face-attributes face-or-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 (defun ps-plot-with-face (from to face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 (if face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 (let* ((face-attr (ps-face-attribute-list face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 (bold-p (nth 0 face-attr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 (italic-p (nth 1 face-attr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 (underline-p (nth 2 face-attr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (foreground (nth 3 face-attr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 (background (nth 4 face-attr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 (fg-color (if (and ps-print-color-p
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2628 (ps-color-device)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 foreground)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 (mapcar 'ps-color-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 (ps-color-values foreground))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 ps-default-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 (bg-color (if (and ps-print-color-p
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2634 (ps-color-device)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 background)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 (mapcar 'ps-color-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 (ps-color-values background)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 (ps-plot-region from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 (cond ((and bold-p italic-p) 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 (italic-p 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 (bold-p 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 (t 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 ; (or fg-color '(0.0 0.0 0.0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 fg-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 bg-color underline-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (goto-char to)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 (defun ps-emacs-face-kind-p (face kind kind-regex kind-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 (let ((frame-font (face-font face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 (face-defaults (face-font face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 ;; Check FACE defaults:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 (and (listp face-defaults)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 (memq kind face-defaults))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 ;; Check the user's preferences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 (memq face kind-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 (defun ps-xemacs-face-kind-p (face kind kind-regex kind-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 (let* ((frame-font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 (or (face-font-instance face) (face-font-instance 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 (kind-cons (and frame-font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 (assq kind (font-instance-properties frame-font))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 (kind-spec (cdr-safe kind-cons))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 (case-fold-search t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 (or (and kind-spec (string-match kind-regex kind-spec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 ;; Kludge-compatible:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 (memq face kind-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 (defun ps-face-bold-p (face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 (if (eq ps-print-emacs-type 'emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 (ps-emacs-face-kind-p face 'bold "-\\(bold\\|demibold\\)-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 ps-bold-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 ps-bold-faces)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 (defun ps-face-italic-p (face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 (if (eq ps-print-emacs-type 'emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 (ps-emacs-face-kind-p face 'italic "-[io]-" ps-italic-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o" ps-italic-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 (ps-xemacs-face-kind-p face 'SLANT "i\\|o" ps-italic-faces))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 (defun ps-face-underlined-p (face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 (or (face-underline-p face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 (memq face ps-underlined-faces)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 ;; Ensure that face-list is fbound.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 (or (fboundp 'face-list) (defalias 'face-list 'list-faces))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 (defun ps-build-reference-face-lists ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 (if ps-auto-font-detect
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 96
diff changeset
2695 (let ((faces (if (eq ps-print-emacs-type 'xemacs)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 96
diff changeset
2696 (face-list 5)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 96
diff changeset
2697 (face-list)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 the-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 (setq ps-ref-bold-faces nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 ps-ref-italic-faces nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 ps-ref-underlined-faces nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 (while faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 (setq the-face (car faces))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 (if (ps-face-italic-p the-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 (setq ps-ref-italic-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 (cons the-face ps-ref-italic-faces)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 (if (ps-face-bold-p the-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 (setq ps-ref-bold-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 (cons the-face ps-ref-bold-faces)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 (if (ps-face-underlined-p the-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 (setq ps-ref-underlined-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (cons the-face ps-ref-underlined-faces)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 (setq faces (cdr faces))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 (setq ps-ref-bold-faces ps-bold-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 (setq ps-ref-italic-faces ps-italic-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 (setq ps-ref-underlined-faces ps-underlined-faces))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 (setq ps-build-face-reference nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 (defun ps-mapper (extent list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 (nconc list (list (list (extent-start-position extent) 'push extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 (list (extent-end-position extent) 'pull extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 (defun ps-extent-sorter (a b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 (< (extent-priority a) (extent-priority b)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 (defun ps-print-ensure-fontified (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (if (and (boundp 'lazy-lock-mode) lazy-lock-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (if (fboundp 'lazy-lock-fontify-region)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2730 (lazy-lock-fontify-region start end) ; the new
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 144
diff changeset
2731 (lazy-lock-fontify-buffer))) ; the old
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 144
diff changeset
2732 (if (and (boundp 'lazy-shot-mode) lazy-shot-mode) ;; temporary untill
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 144
diff changeset
2733 (lazy-shot-fontify-region start end))) ;; lazy-shot is renamed
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 144
diff changeset
2734
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 (defun ps-generate-postscript-with-faces (from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 ;; Build the reference lists of faces if necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 (if (or ps-always-build-face-reference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 ps-build-face-reference)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 (message "Collecting face information...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (ps-build-reference-face-lists)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 ;; Set the color scale. We do it here instead of in the defvar so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 ;; that ps-print can be dumped into emacs. This expression can't be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 ;; evaluated at dump-time because X isn't initialized.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 (setq ps-print-color-scale
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2747 (if (and ps-print-color-p (ps-color-device))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 (float (car (ps-color-values "white")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 1.0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 ;; Generate some PostScript.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 (narrow-to-region from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (let ((face 'default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (position to))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 (ps-print-ensure-fontified from to)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2756 (cond ((or (eq ps-print-emacs-type 'lucid)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2757 (eq ps-print-emacs-type 'xemacs))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 ;; Build the list of extents...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (let ((a (cons 'dummy nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 record type extent extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (map-extents 'ps-mapper nil from to a)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2762 (setq a (sort (cdr a) 'car-less-than-car))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (setq extent-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 ;; Loop through the extents...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (while a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (setq record (car a))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (setq position (car record))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 (setq record (cdr record))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 (setq type (car record))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 (setq record (cdr record))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 (setq extent (car record))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 ;; Plot up to this record.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 ;; XEmacs 19.12: for some reason, we're getting into a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 ;; situation in which some of the records have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 ;; positions less than 'from'. Since we've narrowed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 ;; the buffer, this'll generate errors. This is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 ;; hack, but don't call ps-plot-with-face unless from >
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 ;; point-min.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 (if (and (>= from (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 (<= position (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 (ps-plot-with-face from position face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 ((eq type 'push)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 (if (extent-face extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (setq extent-list (sort (cons extent extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 'ps-extent-sorter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 ((eq type 'pull)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 (setq extent-list (sort (delq extent extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 'ps-extent-sorter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 (setq face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (if extent-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (extent-face (car extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 (setq from position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (setq a (cdr a)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 ((eq ps-print-emacs-type 'emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 (let ((property-change from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 (overlay-change from))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 (while (< from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (if (< property-change to) ; Don't search for property change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 ; unless previous search succeeded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 (setq property-change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 (next-property-change from nil to)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (if (< overlay-change to) ; Don't search for overlay change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 ; unless previous search succeeded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 (setq overlay-change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 (min (next-overlay-change from) to)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (setq position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 (min property-change overlay-change))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2821 ;; The code below is not quite correct,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2822 ;; because a non-nil overlay invisible property
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2823 ;; which is inactive according to the current value
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2824 ;; of buffer-invisibility-spec nonetheless overrides
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2825 ;; a face text property.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (setq face
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2827 (cond ((let ((prop (get-text-property from 'invisible)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2828 ;; Decide whether this invisible property
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2829 ;; really makes the text invisible.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2830 (if (eq buffer-invisibility-spec t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2831 (not (null prop))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2832 (or (memq prop buffer-invisibility-spec)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2833 (assq prop buffer-invisibility-spec))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2834 nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 ((get-text-property from 'face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 (t 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 (let ((overlays (overlays-at from))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 (face-priority -1)) ; text-property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 (while overlays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (let* ((overlay (car overlays))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 (overlay-face (overlay-get overlay 'face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 (overlay-invisible (overlay-get overlay 'invisible))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (overlay-priority (or (overlay-get overlay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 'priority)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 (if (and (or overlay-invisible overlay-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 (> overlay-priority face-priority))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2848 (setq face (cond ((if (eq buffer-invisibility-spec t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2849 (not (null overlay-invisible))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2850 (or (memq overlay-invisible buffer-invisibility-spec)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2851 (assq overlay-invisible buffer-invisibility-spec)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2852 nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 ((and face overlay-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 face-priority overlay-priority)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (setq overlays (cdr overlays))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 ;; Plot up to this record.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (ps-plot-with-face from position face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (setq from position)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (ps-plot-with-face from to face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (defun ps-generate-postscript (from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (ps-plot-region from to 0 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 (defun ps-generate (buffer from to genfunc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (let ((from (min to from))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2866 (to (max to from))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2867 ;; This avoids trouble if chars with read-only properties
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2868 ;; are copied into ps-spool-buffer.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2869 (inhibit-read-only t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 (narrow-to-region from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 (if ps-razzle-dazzle
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2873 (message "Formatting...%3d%%" (setq ps-razchunk 0)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 (setq ps-source-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (setq ps-spool-buffer (get-buffer-create ps-spool-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (ps-init-output-queue)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 (let (safe-marker completed-safely needs-begin-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 ;; Get a marker and make it point to the current end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 ;; buffer, If an error occurs, we'll delete everything from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 ;; the end of this marker onwards.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 (setq safe-marker (make-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (set-marker safe-marker (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 (goto-char (point-min))
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 82
diff changeset
2890 (if (looking-at (regexp-quote ps-adobe-tag))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (setq needs-begin-file t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 (set-buffer ps-source-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (if needs-begin-file (ps-begin-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 (ps-begin-job)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 (ps-begin-page))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (set-buffer ps-source-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 (funcall genfunc from to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (ps-end-page)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (if (and ps-spool-duplex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (= (mod ps-page-count 2) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 (ps-dummy-page))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (ps-flush-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 ;; Back to the PS output buffer to set the page count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (while (re-search-backward "^/PageCount 0 def$" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 (replace-match (format "/PageCount %d def" ps-page-count) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2913 ;; Setting this variable tells the unwind form that
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 ;; the postscript was generated without error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (setq completed-safely t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2917 ;; Unwind form: If some bad mojo occurred while generating
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 ;; postscript, delete all the postscript that was generated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 ;; This protects the previously spooled files from getting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 ;; corrupted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 (if (and (markerp safe-marker) (not completed-safely))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 (delete-region (marker-position safe-marker) (point-max))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (message "Formatting...done")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
2929 ;; Permit dynamic evaluation at print time of ps-lpr-switches
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 (defun ps-do-despool (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 (if (or (not (boundp 'ps-spool-buffer))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2932 (not (symbol-value 'ps-spool-buffer)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 (message "No spooled PostScript to print")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 (ps-end-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 (ps-flush-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 (if filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 (message "Saving..."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 (set-buffer ps-spool-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 (setq filename (expand-file-name filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 (write-region (point-min) (point-max) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 (message "Wrote %s" filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 ;; Else, spool to the printer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (message "Printing..."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (set-buffer ps-spool-buffer)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2950 (if (and (eq system-type 'ms-dos) (stringp dos-ps-printer))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2951 (write-region (point-min) (point-max) dos-ps-printer t 0)
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
2952 (let ((binary-process-input t) ; for MS-DOS
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2953 (ps-lpr-sw ; Dynamic evaluation
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2954 (ps-flatten-list (mapcar 'ps-eval-switch ps-lpr-switches))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2955 (apply 'call-process-region
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2956 (point-min) (point-max) ps-lpr-command nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2957 (if (fboundp 'start-process) 0 nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2958 nil
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
2959 ps-lpr-sw))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (if ps-razzle-dazzle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 (message "Printing...done")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 (kill-buffer ps-spool-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2964 ;; Dynamic evaluation
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2965 (defun ps-eval-switch (arg)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2966 (cond ((stringp arg) arg)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2967 ((functionp arg) (apply arg nil))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2968 ((symbolp arg) (symbol-value arg))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2969 ((consp arg) (apply (car arg) (cdr arg)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2970 (t nil)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2971
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2972 ;; `ps-flatten-list' is defined here (copied from "message.el" and
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2973 ;; enhanced to handle dotted pairs as well) until we can get some
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2974 ;; sensible autoloads, or `flatten-list' gets put somewhere decent.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2975
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2976 ;; (ps-flatten-list '((a . b) c (d . e) (f g h) i . j))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2977 ;; => (a b c d e f g h i j)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2978
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2979 (defun ps-flatten-list (&rest list)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2980 (ps-flatten-list-1 list))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2981
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2982 (defun ps-flatten-list-1 (list)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2983 (cond
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2984 ((null list) (list))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2985 ((consp list)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2986 (append (ps-flatten-list-1 (car list))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2987 (ps-flatten-list-1 (cdr list))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2988 (t (list list))))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
2989
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 (defun ps-kill-emacs-check ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 (let (ps-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 (if (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 (buffer-modified-p ps-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 (if (y-or-n-p "Unprinted PostScript waiting; print now? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 (ps-despool)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 (if (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (buffer-modified-p ps-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 (if (yes-or-no-p "Unprinted PostScript waiting; exit anyway? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 (error "Unprinted PostScript")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 (if (fboundp 'add-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 (add-hook 'kill-emacs-hook 'ps-kill-emacs-check)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 (if kill-emacs-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 (message "Won't override existing kill-emacs-hook")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 (setq kill-emacs-hook 'ps-kill-emacs-check)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 ;;; Sample Setup Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 ;; This stuff is for anybody that's brave enough to look this far,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 ;; and able to figure out how to use it. It isn't really part of ps-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 ;; print, but I'll leave it here in hopes it might be useful:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 ;; WARNING!!! The following code is *sample* code only. Don't use it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 ;; unless you understand what it does!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 (defmacro ps-prsc () (list 'if (list 'eq 'ps-print-emacs-type ''emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 [f22] ''f22))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 (defmacro ps-c-prsc () (list 'if (list 'eq 'ps-print-emacs-type ''emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 [C-f22]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 ''(control f22)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 (defmacro ps-s-prsc () (list 'if (list 'eq 'ps-print-emacs-type ''emacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 [S-f22]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 ''(shift f22)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026 ;; Look in an article or mail message for the Subject: line. To be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 ;; placed in ps-left-headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 (defun ps-article-subject ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 (goto-char (point-min))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3031 (if (re-search-forward "^Subject:[ \t]+\\(.*\\)$" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (buffer-substring (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 "Subject ???")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 ;; Look in an article or mail message for the From: line. Sorta-kinda
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 ;; understands RFC-822 addresses and can pull the real name out where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 ;; it's provided. To be placed in ps-left-headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 (defun ps-article-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 (goto-char (point-min))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3041 (if (re-search-forward "^From:[ \t]+\\(.*\\)$" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (let ((fromstring (buffer-substring (match-beginning 1) (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 ;; Try first to match addresses that look like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 ;; thompson@wg2.waii.com (Jim Thompson)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 ((string-match ".*[ \t]+(\\(.*\\))" fromstring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (substring fromstring (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 ;; Next try to match addresses that look like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 ;; Jim Thompson <thompson@wg2.waii.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 ((string-match "\\(.*\\)[ \t]+<.*>" fromstring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (substring fromstring (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 ;; Couldn't find a real name -- show the address instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 (t fromstring)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 "From ???")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 ;; A hook to bind to gnus-Article-prepare-hook. This will set the ps-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 ;; left-headers specially for gnus articles. Unfortunately, gnus-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 ;; article-mode-hook is called only once, the first time the *Article*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 ;; buffer enters that mode, so it would only work for the first time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 ;; we ran gnus. The second time, this hook wouldn't get set up. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 ;; only alternative is gnus-article-prepare-hook.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 (defun ps-gnus-article-prepare-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 (setq ps-header-lines 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 (setq ps-left-header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 ;; The left headers will display the article's subject, its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 ;; author, and the newsgroup it was in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 (list 'ps-article-subject 'ps-article-author 'gnus-newsgroup-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 ;; A hook to bind to vm-mode-hook to locally bind prsc and set the ps-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 ;; left-headers specially for mail messages. This header setup would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 ;; also work, I think, for RMAIL.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 (defun ps-vm-mode-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (local-set-key (ps-prsc) 'ps-vm-print-message-from-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (setq ps-header-lines 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (setq ps-left-header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 ;; The left headers will display the message's subject, its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 ;; author, and the name of the folder it was in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (list 'ps-article-subject 'ps-article-author 'buffer-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 ;; Every now and then I forget to switch from the *Summary* buffer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 ;; the *Article* before hitting prsc, and a nicely formatted list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 ;; article subjects shows up at the printer. This function, bound to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 ;; prsc for the gnus *Summary* buffer means I don't have to switch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 ;; buffers first.
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3088 ;; sb: Updated for Gnus 5.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (defun ps-gnus-print-article-from-summary ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 (interactive)
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3091 (let ((ps-buf (if (boundp 'gnus-article-buffer)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3092 gnus-article-buffer
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3093 "*Article*")))
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3094 (if (get-buffer ps-buf)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3095 (save-excursion
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3096 (set-buffer ps-buf)
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
3097 (ps-spool-buffer-with-faces)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 ;; See ps-gnus-print-article-from-summary. This function does the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 ;; same thing for vm.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 (defun ps-vm-print-message-from-summary ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 (interactive)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3103 (if (and (boundp 'vm-mail-buffer) (symbol-value 'vm-mail-buffer))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 (save-excursion
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3105 (set-buffer (symbol-value 'vm-mail-buffer))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (ps-spool-buffer-with-faces))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 ;; A hook to bind to bind to gnus-summary-setup-buffer to locally bind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 ;; prsc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 (defun ps-gnus-summary-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (local-set-key (ps-prsc) 'ps-gnus-print-article-from-summary))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 ;; Look in an article or mail message for the Subject: line. To be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 ;; placed in ps-left-headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (defun ps-info-file ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (goto-char (point-min))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3118 (if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (buffer-substring (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 "File ???")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 ;; Look in an article or mail message for the Subject: line. To be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 ;; placed in ps-left-headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (defun ps-info-node ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (goto-char (point-min))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3127 (if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 (buffer-substring (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 "Node ???")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 (defun ps-info-mode-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (setq ps-left-header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 ;; The left headers will display the node name and file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 (list 'ps-info-node 'ps-info-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 ;; WARNING! The following function is a *sample* only, and is *not*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 ;; meant to be used as a whole unless you understand what the effects
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3138 ;; will be! (In fact, this is a copy of Jim's setup for ps-print --
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3139 ;; I'd be very surprised if it was useful to *anybody*, without
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 ;; modification.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 (defun ps-jts-ps-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (global-set-key (ps-prsc) 'ps-spool-buffer-with-faces) ;f22 is prsc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (global-set-key (ps-s-prsc) 'ps-spool-region-with-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (global-set-key (ps-c-prsc) 'ps-despool)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 (add-hook 'vm-mode-hook 'ps-vm-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (add-hook 'vm-mode-hooks 'ps-vm-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (add-hook 'Info-mode-hook 'ps-info-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 (setq ps-spool-duplex t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (setq ps-print-color-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (setq ps-lpr-command "lpr")
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3154 (setq ps-lpr-switches '("-Jjct,duplex_long"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3155 'ps-jts-ps-setup)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3156
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3157 ;; WARNING! The following function is a *sample* only, and is *not*
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3158 ;; meant to be used as a whole unless it corresponds to your needs.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3159 ;; (In fact, this is a copy of Jack's setup for ps-print --
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3160 ;; I would not be that surprised if it was useful to *anybody*,
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3161 ;; without modification.)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3162
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3163 (defun ps-jack-setup ()
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3164 (setq ps-print-color-p 'nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3165 ps-lpr-command "lpr"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3166 ps-lpr-switches (list)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3167
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3168 ps-paper-type 'a4
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3169 ps-landscape-mode 't
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3170 ps-number-of-columns 2
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3171
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3172 ps-left-margin (/ (* 72 1.0) 2.54) ; 1.0 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3173 ps-right-margin (/ (* 72 1.0) 2.54) ; 1.0 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3174 ps-inter-column (/ (* 72 1.0) 2.54) ; 1.0 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3175 ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3176 ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3177 ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3178 ps-header-line-pad .15
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3179 ps-print-header t
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3180 ps-print-header-frame t
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3181 ps-header-lines 2
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3182 ps-show-n-of-n t
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3183 ps-spool-duplex nil
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3184
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3185 ps-font-family 'Courier
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3186 ps-font-size 5.5
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3187 ps-header-font-family 'Helvetica
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3188 ps-header-font-size 6
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3189 ps-header-title-font-size 8)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 74
diff changeset
3190 'ps-jack-setup)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 (provide 'ps-print)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 ;;; ps-print.el ends here