2 %% PostScript Header for use by m2ps Ver.2.2
3 %% Copyright (C) 1992 Free Software Foundation, Inc.
5 %% This file is part of Mule (MULtilingual Enhancement of GNU Emacs).
7 %% Mule is free software distributed in the form of patches to GNU Emacs.
8 %% You can redistribute it and/or modify
9 %% it under the terms of the GNU General Public License as published by
10 %% the Free Software Foundation; either version 1, or (at your option)
13 %% Mule is distributed in the hope that it will be useful,
14 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
15 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 %% GNU General Public License for more details.
18 %% You should have received a copy of the GNU General Public License
19 %% along with GNU Emacs; see the file COPYING. If not, write to
20 %% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 %% 92.10.8 written by K.Handa <handa@etl.go.jp>
23 %% 92.12.15 modified by K.Handa <handa@etl.go.jp>
24 %% Support composite character.
26 /Mydict 200 dict def % define a working dictionary
27 Mydict begin % start using it.
29 %%%% Font Manipulation
31 /imagemaskmatrix [0 0 0 0 0 0] def
33 /BuildGlyphDefault { % fontdict charname BuildGlyphDefault -
35 1 index /CharData get exch get /ch exch def
36 /FontSize get /fs exch def
37 ch 0 get fs div 0 ch 1 4 getinterval { fs div } forall setcachedevice
38 ch 5 get ch 6 get 2 copy
42 dup 0 fs put dup 3 fs neg put
43 dup 4 ch 7 get put dup 5 ch 8 get put
44 ch 9 1 getinterval cvx
52 /BuildGlyphNoCache { % fontdict charname BuildGlyphNoCache -
54 1 index /CharData get exch get /ch exch def
55 /FontSize get /fs exch def
56 ch 0 get fs div 0 setcharwidth
57 ch 5 get ch 6 get 2 copy
61 dup 0 fs put dup 3 fs neg put
62 dup 4 ch 7 get put dup 5 ch 8 get put
63 ch 9 1 getinterval cvx
71 /BuildGlyphDefault load 0 6 dict put
72 /BuildGlyphNoCache load 0 6 dict put
76 /nf { % font fontname fsize bbox rel cache nf - % NEWFONT
80 { /BuildGlyph { BuildGlyphDefault } def }
81 { /BuildGlyph { BuildGlyphNoCache } def }
86 /FontMatrix [1 0 0 1 0 0] def
87 /Encoding 256 array %def
91 work exch 1 exch putinterval
96 /CharData 256 dict def
98 1 index /Encoding get exch get
99 1 index /BuildGlyph get exec
104 findfont FontScale scalefont def
107 /g { % charname chardata g - % NEWGLYPH
109 CharData begin def end
113 /f { % font f - % SETFONT
118 /bp { % - bp - % BEGIN OF PAGE
119 ShortMemory { save /SaveImage exch def } if
125 /ep { % - ep - % END OF PAGE
127 ShortMemory { SaveImage restore } if
130 %%%% Miscellaneous Routines for reducing traffic
132 /r { % x r - % MOVE RIGHT
136 /n { % - n - % NEWLINE
137 /y y LinePitch sub def LeftMargin y moveto
140 /s { % string s - % SHOW STRING
144 /cs1 { % string cs1 - % SHOW COMP-CHAR
145 dup 0 get /ch exch def
146 currentfont /CharData get currentfont /Encoding get ch get get
147 dup 2 get /lly exch def
149 currentfont /Relative get /rel exch def
150 ury rel lt { /ury rel def } if
151 lly 0 gt { /lly 0 def } if
152 currentpoint /yy exch def /xx exch def
156 /cs2 { % string cs2 - % SHOW COMP-CHAR
158 dup 0 get /ch exch def
159 currentfont /FontSize get /fs exch def
160 currentfont /CharData get currentfont /Encoding get ch get get
161 dup 2 get /llyy exch def
165 0 ury llyy sub 1 add fs div FontScale mul rmoveto
166 /ury ury llyy sub uryy add 1 add def
168 0 lly uryy sub 1 sub fs div FontScale mul rmoveto
169 /lly lly uryy sub llyy add 1 sub def
171 uryy ury gt { /ury uryy def } if
172 llyy lly lt { /lly llyy def } if
178 /cs3 { % string cs3 - % SHOW COMP-CHAR