cdesktopenv/cde/programs/fontaliases/postscript/zh_TW/prolog.ps

294 lines
9.9 KiB
PostScript

%!
% $XConsortium: prolog.ps /main/3 1996/11/19 16:37:57 drk $
% RESTRICTED CONFIDENTIAL INFORMATION:
%
% The information in this document is subject to special
% restrictions in a confidential disclosure agreement between
% HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
% document outside HP, IBM, Sun, USL, SCO, or Univel without
% Sun's specific written approval. This document and all copies
% and derivative works thereof must be returned or destroyed at
% Sun's request.
%
% Copyright 1993 Sun Microsystems, Inc. All rights reserved.
%
% Prolog of cmprint & mp for tchinese EUC font definition
/ConstantWidth false def
/checkfont {
5 dict begin
/basefontname exch def
/basefontdict basefontname findfont def
/newfont basefontdict maxlength dict def
basefontdict {
exch dup /FID ne
{ exch newfont 3 1 roll put }
{ pop pop }
ifelse
} forall
newfont /FontName get
end
} def
/Ming-Light.r21 checkfont
/Courier eq { /GotFont false def } { /GotFont true def } ifelse
GotFont { /Ming-Light findfont pop
/MingRare-Light findfont pop
/MingUnusual-Light findfont pop
/Kai-Medium findfont pop
/KaiRare-Medium findfont pop
/KaiUnusual-Medium findfont pop } if
/append { % str1 str2 => str3
1 index length dup 2 index length add string % s1 s2 l1 s3
dup 5 -1 roll 0 exch putinterval % s2 l1 s3
dup 4 2 roll exch putinterval
} bind def
/_tohex {
dup 10 eq {(A)}{ dup 11 eq {(B)}{ dup 12 eq {(C)}{ dup 13 eq {(D)}{
dup 14 eq {(E)}{ dup 15 eq {(F)}{ dup 16 ge {(0)}{dup 1 string cvs
}ifelse }ifelse }ifelse }ifelse }ifelse }ifelse }ifelse exch pop
} bind def
/tohex { % int => (hex)
dup 16 mod % AB Y
exch 16 idiv % Y X
_tohex exch _tohex % (X) (Y)
2 string dup dup % (x) (y) ( ) ( ) ( )
5 -1 roll 0 exch putinterval % (y) (x ) (x )
3 -1 roll 1 exch putinterval
} bind def
/repeat-findfont { % (Ming-Light.r) start end => dict..
3 -1 roll /fontname exch def
1 exch {
fontname length 2 add string dup % 33 ( ) ( )
0 fontname putinterval % 33 (Ming-Light.r )
dup fontname length 4 -1 roll % (..) (..) 14 33
tohex putinterval cvn findfont
} for
} bind def
/makecodesets { % (fontname) => font
/CodeSet1 exch def
/CodeSet2_P2 exch def
/CodeSet2_P14 exch def
/CodeSet2_P2
13 dict begin
/FontName 1 index def
/FMapType 5 def
/Encoding [
64 {0} repeat % 80 - 9F
0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7
0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15
0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23
0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31
0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39
0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47
0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55
0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63
0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71
0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79
0 80 0 81 0 82 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
] def
/WMode 0 def
/FontType 0 def
/FontMatrix matrix def
/FDepVector [
/NotDefFont findfont
CodeSet2_P2 (.r) append 33 114 repeat-findfont
/NotDefFont findfont
] def
currentdict
end
definefont pop
/CodeSet2_P14
15 dict begin
/FontName 1 index def
/FMapType 5 def
/Encoding [
64 {0} repeat % 80 - 9F
0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7
0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15
0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23
0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31
0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39
0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47
0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55
0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63
0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71
0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79
0 80 0 81 0 82 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
] def
/WMode 0 def
/FontType 0 def
/FontMatrix matrix def
/FDepVector [
/NotDefFont findfont
CodeSet2_P14 (.r) append 33 100 repeat-findfont
15 { /NotDefFont findfont } repeat
] def
currentdict
end
definefont pop
/CodeSet2
13 dict begin
/FontName 1 index def
/FMapType 5 def
/Encoding [
64 {0} repeat % 80 - 9F
4 {0} repeat % A0 - A1
0 1 % A2
22 {0} repeat % A3 - AD
0 2 % AE
0 0 % AF
160 {0} repeat
] def
/WMode 0 def
/FontType 0 def
/FontMatrix matrix def
/FDepVector [
/NotDefFont findfont
/CodeSet2_P2 findfont
/CodeSet2_P14 findfont
] def
currentdict
end
definefont pop
/CodeSet1
13 dict begin
/FontName 1 index def
/FMapType 5 def
/Encoding [
16 {0} repeat % 80 - 87
12 {0} repeat % 88 - 8D
0 94 0 0 % 8E - 8F
32 {0} repeat % 9A - 9F
0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7
0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15
0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23
0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31
0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39
0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47
0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55
0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63
0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71
0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79
0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87
0 88 0 89 0 90 0 91 0 92 0 93 0 0 0 0
] def
/WMode 0 def
/FontType 0 def
/FontMatrix matrix def
/FDepVector [
/NotDefFont findfont
CodeSet1 (.r) append 33 37 repeat-findfont
30 { /NotDefFont findfont } repeat
CodeSet1 (.r) append 68 125 repeat-findfont
/CodeSet2 findfont
4 { /NotDefFont findfont } repeat
] def
currentdict
end
definefont pop
(CodeSet1)
} bind def
/makeEUCfont { % 123font (fontname) => -
(LC_) 1 index append
13 dict begin
/FontName 1 index def
/FMapType 4 def
/Encoding [ 0 1 ] def
/WMode 0 def
/FontType 0 def
/FontMatrix matrix def
/FDepVector [
4 -1 roll findfont
ConstantWidth {
dup 1000 exch 1000 scalefont setfont
(ab) stringwidth pop div scalefont
} if
5 -1 roll findfont
] def
currentdict
end
definefont
pop
} bind def
/copyfont {
5 dict begin
/newfontname exch def
/basefontname exch def
/basefontdict basefontname findfont def
/newfont basefontdict maxlength dict def
basefontdict {
exch dup /FID ne
{ exch newfont 3 1 roll put }
{ pop pop }
ifelse
} forall
newfont /FontName newfontname put
newfontname newfont definefont pop
end
} def
% define LC_Times-Roman for tchinese locale
%
GotFont { (MingUnusual-Light) (MingRare-Light) (Ming-Light) makecodesets
(Times-Roman) makeEUCfont }
{ /Times-Roman /LC_Times-Roman copyfont } ifelse
% LC_Times-Bold
%
GotFont { (MingUnusual-Light) (MingRare-Light) (Ming-Light) makecodesets
(Times-Bold) makeEUCfont }
{ /Times-Bold /LC_Times-Bold copyfont } ifelse
% LC_Times-Italic
%
GotFont { (MingUnusual-Light) (MingRare-Light) (Ming-Light) makecodesets
(Times-Italic) makeEUCfont }
{ /Times-Italic /LC_Times-Italic copyfont } ifelse
% LC_Helvetica
%
GotFont { (KaiUnusual-Medium) (KaiRare-Medium) (Kai-Medium) makecodesets
(Helvetica) makeEUCfont }
{ /Helvetica /LC_Helvetica copyfont } ifelse
% LC_Helvetica-Bold
%
GotFont { (KaiUnusual-Medium) (KaiRare-Medium) (Kai-Medium) makecodesets
(Helvetica-Bold) makeEUCfont }
{ /Helvetica-Bold /LC_Helvetica-Bold copyfont } ifelse
% LC_Courier
%
/ConstantWidth true def
GotFont { (MingUnusual-Light) (MingRare-Light) (Ming-Light) makecodesets
(Courier) makeEUCfont }
{ /Courier /LC_Courier copyfont } ifelse
/ConstantWidth false def
% LC_Helvetica-BoldOblique
%
GotFont { (KaiUnusual-Medium) (KaiRare-Medium) (Kai-Medium) makecodesets
(Helvetica-BoldOblique) makeEUCfont }
{ /Helvetica-BoldOblique /LC_Helvetica-BoldOblique copyfont } ifelse