File: PSheader

package info (click to toggle)
sdop 1.10-3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,404 kB
  • sloc: ansic: 21,477; xml: 8,536; sh: 265; perl: 199; makefile: 142
file content (253 lines) | stat: -rw-r--r-- 7,923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
%% Header file for sdop PostScript output
% Created: July 06 2005
% Last update: April 28 2023

% Blank lines and lines starting with a single % are not copied to the output.

%%BeginProlog


% Ensure that the pdfmark stuff is ignored by interpreters that do not
% support it.

/pdfmark where                    % Is pdfmark already available?
   { pop }                        % Yes: do nothing (use that definition)
   {                              % No: define pdfmark as follows:
   /globaldict where              % globaldict is preferred because
       { pop globaldict }         % globaldict is always visible; else,
       { userdict }               % use userdict otherwise.
   ifelse
   /pdfmark /cleartomark load put
   }                              % Define pdfmark to remove all objects
ifelse                            % up to and including the mark object.


% ====================== Font Encoding Stuff ==================================
% For fonts that use Adobe's standard encoding (that is, normal text fonts),
% we are going to bind each font twice, to give us 512 characters to play with.
% This is sufficient to encode all existing characters in the normal fonts.

% Here are the two encoding vectors. The first 256 characters are encoded with
% the Unicode encoding.

/LowerEncoding 256 array def
LowerEncoding 0 [
% 00 - 0F
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
% 10 - 1F
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
% 20 - 2F
/space/exclam/quotedbl/numbersign
/dollar/percent/ampersand/quotesingle
/parenleft/parenright/asterisk/plus
/comma/hyphen/period/slash
% 30 - 3F
/zero/one/two/three
/four/five/six/seven
/eight/nine/colon/semicolon
/less/equal/greater/question
% 40 - 4F
/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
% 50 - 5F
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft
/backslash/bracketright/asciicircum/underscore
% 60 - 6F
/grave/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o
% 70 - 7F
/p/q/r/s/t/u/v/w/x/y/z/braceleft
/bar/braceright/asciitilde/currency
% 80 - 8F
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
% 90 - 9F
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
/currency/currency/currency/currency
% A0 - AF
/space/exclamdown/cent/sterling
/currency/yen/brokenbar/section
/dieresis/copyright/ordfeminine/guillemotleft
/logicalnot/hyphen/registered/macron
% B0 - BF
/degree/plusminus/twosuperior/threesuperior
/acute/mu/paragraph/bullet
/cedilla/onesuperior/ordmasculine/guillemotright
/onequarter/onehalf/threequarters/questiondown
% C0 - CF
/Agrave/Aacute/Acircumflex/Atilde
/Adieresis/Aring/AE/Ccedilla
/Egrave/Eacute/Ecircumflex/Edieresis
/Igrave/Iacute/Icircumflex/Idieresis
% D0 - DF
/Eth/Ntilde/Ograve/Oacute
/Ocircumflex/Otilde/Odieresis/multiply
/Oslash/Ugrave/Uacute/Ucircumflex
/Udieresis/Yacute/Thorn/germandbls
% E0 - EF
/agrave/aacute/acircumflex/atilde
/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis
/igrave/iacute/icircumflex/idieresis
% F0 - FF
/eth/ntilde/ograve/oacute
/ocircumflex/otilde/odieresis/divide
/oslash/ugrave/uacute/ucircumflex
/udieresis/yacute/thorn/ydieresis
]putinterval

% The next encoding vector uses Unicode for the first 128 characters (Latin
% Extended-A). Not all of these characters are in older Adobe-encoded fonts.
% The remaining code points in the vector are used arbitrarily for the
% remaining Adobe standardly encoded characters. This latter part of the
% encoding must be kept in step with the appropriate table in the code.

/UpperEncoding 256 array def
UpperEncoding 0 [
% 100 - 10F
/Amacron/amacron/Abreve/abreve
/Aogonek/aogonek/Cacute/cacute
/Ccircumflex/ccircumflex/Cdotaccent/cdotaccent
/Ccaron/ccaron/Dcaron/dcaron
% 110 - 11F
/Dcroat/dcroat/Emacron/emacron
/Ebreve/ebreve/Edotaccent/edotaccent
/Eogonek/eogonek/Ecaron/ecaron
/Gcircumflex/gcircumflex/Gbreve/gbreve
% 120 - 12F
/Gdotaccent/gdotaccent/Gcommaaccent/gcommaaccent
/Hcircumflex/hcircumflex/Hbar/hbar
/Itilde/itilde/Imacron/imacron
/Ibreve/ibreve/Iogonek/iogonek
% 130 - 13f
/Idotaccent/dotlessi/IJ/ij
/Jcircumflex/jcircumflex/Kcommaaccent/kcommaaccent
/kgreenlandic/Lacute/lacute/Lcommaaccent
/lcommaaccent/Lcaron/lcaron/Ldot
% 140 - 14F
/ldot/Lslash/lslash/Nacute
/nacute/Ncommaaccent/ncommaaccent/Ncaron
/ncaron/napostrophe/Eng/eng
/Omacron/omacron/Obreve/obreve
% 150 - 15F
/Ohungarumlaut/ohungarumlaut/OE/oe
/Racute/racute/Rcommaaccent/rcommaaccent
/Rcaron/rcaron/Sacute/sacute
/Scircumflex/scircumflex/Scedilla/scedilla
% 160 - 16F
/Scaron/scaron/Tcedilla/tcedilla
/Tcaron/tcaron/Tbar/tbar
/Utilde/utilde/Umacron/umacron
/Ubreve/ubreve/Uring/uring
% 170 - 17F
/Uhungarumlaut/uhungarumlaut/Uogonek/uogonek
/Wcircumflex/wcircumflex/Ycircumflex/ycircumflex
/Ydieresis/Zacute/zacute/Zdotaccent
/zdotaccent/Zcaron/zcaron/longs
% --------------------------------------------------------------------
% These are the remaining characters in the Adobe standard encoding,
% in alphabetic order (seems as good as any other).
% --------------------------------------------------------------------
% 180 - 18F
/Delta/Euro/Scommaaccent/Tcommaaccent
/breve/caron/circumflex/commaaccent
/dagger/daggerdbl/dotaccent/ellipsis
/emdash/endash/fi/fl
% 190 - 19F
/florin/fraction/greaterequal/guilsinglleft
/guilsinglright/hungarumlaut/lessequal/lozenge
/minus/notequal/ogonek/partialdiff
/periodcentered/perthousand/quotedblbase/quotedblleft
% 1A0 - 1AF
/quotedblright/quoteleft/quoteright/quotesinglbase
/radical/ring/scommaaccent/summation
/tcommaaccent/tilde/trademark/infinity
]putinterval


% Routine to initially find a font and re-encode it if necessary.
% On the stack we should have two names, for the two differently encoded
% versions of the font. When the font is not re-encoded, the two will end
% up the same. Following the two names is the font name.

/inf{findfont

% At this point we have on the stack the two names, followed by the font.
% Test to see whether it uses the Adobe Standard encoding.

dup dup/Encoding get StandardEncoding eq

% If the result is true, we obey the following.

% Find the maximum length of the font's dictionary, and make two new
% dictionaries of the same length.

{maxlength dup dict/newfont0 exch def dict/newfont1 exch def

% Copy the original font into the two new ones, ommitting only the FID.

dup
{1 index/FID eq{pop pop}{newfont0 3 1 roll put}ifelse}forall
{1 index/FID eq{pop pop}{newfont1 3 1 roll put}ifelse}forall

% Now set up the two new encodings and define the names.

newfont1/Encoding UpperEncoding put dup newfont1 definefont def
newfont0/Encoding LowerEncoding put dup newfont0 definefont def
}

% If the font does not use the Standard Encoding, we set both names to
% the unmodified font.

{3 1 roll def def}ifelse

}bind def

% ==================== End of Font Encoding Stuff =============================


% Set font from the array of fonts in the vf variable.

/Sf{vf exch get setfont}bind def

% Relative x movement for kerning

/R{0 rmoveto}bind def

% Straightforward abbreviations

/Mt/moveto load def
/RMt/rmoveto load def
/RLt/rlineto load def
/Ct/curveto load def
/Sd/setdash load def
/Slc/setlinecap load def
/Slj/setlinejoin load def
/Slm/setmiterlimit load def
/Slw/setlinewidth load def
/St/stroke load def

% Show left-justified, middle-justified, end-justified

/S/show load def
/SM { dup stringwidth pop 2 div neg 0 RMt show } bind def
/SE { dup stringwidth pop neg 0 RMt show } bind def

% This PostScript procedure tests a number fonts in order until it finds one
% that exists.

/multifindfont{
{dup/Font resourcestatus{pop pop findfont exit}{pop}ifelse}forall
}bind def

%%EndProlog

% End of PostScript header for sdop