Professional Documents
Culture Documents
All rights
reserved.
%
% This software is provided AS-IS with no warranty, either express or
% implied.
%
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
/Type1encode 70 dict
% Data types
dup /nulltype {
pop ()
} put
dup /nametype {
Type1encode exch get
} put
dup /stringtype {
} put
dup /integertype {
dup dup -107 ge exch 107 le and {
139 add (x) dup 0 4 -1 roll put
} {
dup dup -1131 ge exch 1131 le and {
dup 0 ge { 16#f694 } { neg 16#fa94 } ifelse add
(xx) dup dup 0 4 index -8 bitshift put
1 4 -1 roll 255 and put
} {
(\377xxxx) 1 1 4 {
dup 8 mul 32 sub 3 index exch bitshift 255 and
2 index 3 1 roll put
} for exch pop
} ifelse
} ifelse
} put
% Operators
readonly def
Type1encode {
dup type /stringtype eq {
dup length 1 eq { 0 get } { 1 get 256 add } ifelse
% stack: array key code
exch 2 index 3 1 roll put
} {
pop pop
} ifelse
} forall
dup 12 {
dup read pop dup Type1decode exch 256 add get dup null ne
{ exch pop }
{ pop 2 string dup 0 12 put dup 1 4 -1 roll put }
ifelse
} put
dup 28 { % Type 2 only
dup read pop 128 xor 128 sub 8 bitshift
1 index read pop add
} put
32 1 246 { 2 copy dup 139 sub put pop } for
dup 247 { dup read pop 108 add } put
dup 248 { dup read pop 364 add } put
dup 249 { dup read pop 620 add } put
dup 250 { dup read pop 876 add } put
dup 251 { dup read pop 108 add neg } put
dup 252 { dup read pop 364 add neg } put
dup 253 { dup read pop 620 add neg } put
dup 254 { dup read pop 876 add neg } put
dup 255 { % Different for Type 1 and Type 2
dup read pop 128 xor 128 sub
3 { 8 bitshift 1 index read pop add } repeat
FontType 2 eq { 65536.0 div } if
} put
readonly def