home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
adobeenc.zoo
/
encrypt.shar
/
header.ps
< prev
next >
Wrap
Text File
|
1990-10-27
|
4KB
|
174 lines
%!
%
% header.ps
%
% After interpreting a decrypted Adobe font program there are four
dictionaries.
%
% font (implicit)
% FontInfo
% Private
% CharStrings
%
% The strategy is to redefine certain operators, interpret the font and dump
% the resulting dictionaries while filtering out font hint operators.
%
/myString 200 string def
/Helvetica findfont 20 scalefont setfont
/readonly { } def
/executeonly { } def
/noaccess { } def
/definefont { } def
/myWriteString {
print
} def
/numString 20 string def
/printNums {
/i exch def
i 1 sub -1 0 { index numString cvs print ( ) print } for
i { pop } repeat
} def
/clearStack {
cleartomark mark
} def
%
% commands for starting and finishing
%
/endchar { clearStack } def
/seac {
/achar exch def
/bchar exch def
/ady exch def
/adx exch def
/asb exch def
mark Encoding bchar get load exec pop
/xOrigin xOrigin adx add def
/yOrigin yOrigin ady add def
mark Encoding achar get load exec pop clearStack
} def
/hsbw {
pop /xOrigin exch xOrigin add def xOrigin yOrigin 2 printNums
(moveto ) myWriteString clearStack
} def
/sbw {
pop pop /yOrigin exch yOrigin add def /xOrigin exch xOrigin add def
xOrigin yOrigin 2 printNums
(moveto ) myWriteString clearStack
} def
%
% path construction commands
%
% convert the operators and operands to rmoveto, rlineto and rcurveto.
% chars_closepath has different semantics from PostScript closepath.
%
/chars_closepath {
(currentpoint closepath moveto ) myWriteString clearStack
} def
/hlineto { 0 2 printNums (rlineto ) myWriteString clearStack } def
/hmoveto { 0 2 printNums (rmoveto ) myWriteString clearStack } def
/chars_rlineto { 2 printNums (rlineto ) myWriteString clearStack } def
/chars_rmoveto { 2 printNums (rmoveto ) myWriteString clearStack } def
/vlineto { 0 exch 2 printNums (rlineto ) myWriteString clearStack } def
/vmoveto { 0 exch 2 printNums (rmoveto ) myWriteString clearStack } def
/hvcurveto {
/dy3 exch def /dy2 exch def /dx2 exch def /dx1 exch def
dx1 0 dx2 dy2 0 dy3 rrcurveto
} def
/vhcurveto {
/dx3 exch def /dy2 exch def /dx2 exch def /dy1 exch def
0 dy1 dx2 dy2 dx3 0 rrcurveto
} def
/rrcurveto {
/dy3 exch def /dx3 exch def
/dy2 exch def /dx2 exch def
/dy1 exch def /dx1 exch def
dx1 dy1
dx1 dx2 add dy1 dy2 add
dx1 dx2 dx3 add add dy1 dy2 dy3 add add
6 printNums (rcurveto ) myWriteString clearStack
} def
%
% hint commands
%
/dotsection { clearStack } def
/hstem { clearStack } def
/hstem3 { clearStack } def
/vstem { clearStack } def
/vstem3 { clearStack } def
%
% Arithmetic command
%
/chars_div { div } def
%
% Subroutine commands
% All OtherSubr routines are hint related
% For 0, 1, 2 the stack contents are left unchanged.
% For 3, the trailing pop will push a 3 on the stack.
% See p. 95 of the Black Book.
%
/callothersubr {
} def
/callsubr {
/i exch def
i 3 gt { % normal subroutines
Subrs i get exec
} if
i 3 eq { } if
i 0 eq {
% pop pop pop % Flex height control parameter and end points
/yEnd exch def /xEnd exch def pop
/y5 exch def /x5 exch def
/y4 exch def /x4 exch def
/y3 exch def /x3 exch def
/y2 exch def /x2 exch def
/y1 exch def /x1 exch def
/y0 exch def /x0 exch def
/yRef exch def /xRef exch def
x0 xRef add y0 yRef add x1 y1 x2 y2 rrcurveto
x3 y3 x4 y4 x5 y5 rrcurveto
%
% The Flex can be replaced by a lineto.
%
% xEnd yEnd 2 printNums (lineto ) myWriteString
%
/chars_rmoveto { 2 printNums (rmoveto ) myWriteString clearStack } def
} if
i 1 eq {
/chars_rmoveto { } def
} if
i 2 eq {
} if
} def
/return { } def
/chars_pop { 3 } def % chars_pop transfers from PS stack to BuildChar stack
%
% setcurrentpoint shouldn't appear in a charststring program
%