~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to examples/cjk/all_aj2.ps

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%!PS-Adobe-3.0
2
 
%%Title: Adobe-Japan2 CID-Keyed Fonts Character List
3
 
%%Creator: Taiji Yamada <taiji@aihara.co.jp> and gs-cjk project
4
 
%%Copyright: (C) 2001 Taiji Yamada and gs-cjk project
5
 
%%+ This script is part of GNU Ghostscript and is distributed under
6
 
%%+ the terms of the GNU General Public License. See the file COPYING
7
 
%%+ for more information.
8
 
%%Version: 1.0
9
 
%
10
 
% Usage:
11
 
%   gs [-sF=HeiseiMin-W3H] [-daffix [-sAF=WadaMin-RegularH]] \
12
 
%      [-dglyphshow- [-sI=Identity-H]] [-ddescent=200] all_aj2.ps
13
 
%
14
 
%%DocumentMedia: A4 595 842 0 white ()
15
 
%%EndComments
16
 
%%BeginProlog
17
 
 
18
 
/*gs-cjk (\
19
 
------------------------------------------------------------------------\n\
20
 
This is a script to test CJK fonts such as CID-keyed fonts.\n\
21
 
If you have not done CID-keyed fonts installation and definitions at\n\
22
 
/Resource/CMap and CIDFnmap or /Resource/CIDFont of ghostscript, then\n\
23
 
this script can't work correctly.\n\
24
 
For details, please see README at http://www.gyve.org/gs-cjk/supplement.\n\
25
 
 
26
 
If you throw this script into a printer, it requires PostScript 3\n\
27
 
printer and CID-keyed fonts specified in this script.\n\
28
 
------------------------------------------------------------------------\n) def
29
 
 
30
 
/notice*stdout 4 dict begin
31
 
  /*open {} def /*echo-n { =only } def /*echo { = } def /*close { flush } def
32
 
  currentdict
33
 
end def
34
 
 
35
 
/notice*page 5 dict begin
36
 
  /*y 750 def
37
 
  /*open {
38
 
    gsave initmatrix /Courier findfont 11 scalefont setfont 50 *y moveto
39
 
    *y 750 eq {
40
 
      *gs-cjk { (\n) search { *echo } { *echo-n exit } ifelse pop } loop
41
 
    } if
42
 
  } def
43
 
  /*echo-n { dup type /stringtype ne { dup length string cvs } if show } def
44
 
  /*echo { *echo-n /*y *y 11 sub def 50 *y moveto } def
45
 
  /*close { grestore } def
46
 
  currentdict
47
 
end def
48
 
 
49
 
/greeting*gs-cjk {
50
 
  product (Ghostscript) search not { pop } { pop pop pop QUIET not {
51
 
    notice*stdout begin
52
 
      *open
53
 
      *gs-cjk { (\n) search { *echo } { *echo-n exit } ifelse pop } loop
54
 
      *close
55
 
    end
56
 
  } if } ifelse
57
 
} bind def
58
 
greeting*gs-cjk
59
 
 
60
 
/*findfont {
61
 
  dup /Font resourcestatus { pop pop findfont } {
62
 
    notice*page begin
63
 
      *open
64
 
      (Error in findfont: ) *echo-n dup *echo
65
 
      *close
66
 
    end
67
 
    findfont
68
 
  } ifelse
69
 
} bind def
70
 
 
71
 
/*CIDFont*findresource {
72
 
  dup /CIDFont resourcestatus { pop pop /CIDFont findresource } {
73
 
    notice*page begin
74
 
      *open
75
 
      (Error in /CIDFont findresource: ) *echo-n dup *echo
76
 
      *close
77
 
    end
78
 
    /CIDFont findresource
79
 
  } ifelse
80
 
} bind def
81
 
 
82
 
/orighandleerror errordict /handleerror get def
83
 
errordict begin
84
 
  /handleerror {
85
 
    notice*page begin errordict begin $error begin
86
 
      *open
87
 
      (Error of ) *echo-n errorname dup length string cvs *echo
88
 
      *close
89
 
      showpage
90
 
    end end end
91
 
    orighandleerror
92
 
  } bind def
93
 
end
94
 
 
95
 
/title (Adobe-Japan2 CID-Keyed Fonts Character List) def
96
 
/PW 595 def
97
 
/PH 842 def
98
 
/LM 78 def
99
 
/TM 130 def
100
 
/RM 47 def
101
 
/BM 76 def
102
 
/NH 10 def
103
 
/NV 12 def
104
 
/RW PW LM RM add sub NH div def
105
 
/RH PH TM BM add sub NV div def
106
 
/FS RW 3 mul 4 div def
107
 
/AFS RW 1 mul 4 div def
108
 
/unknowndef { exch dup where { pop pop pop } { exch def } ifelse } bind def
109
 
/F (WadaMin-RegularH) unknowndef
110
 
/affix false unknowndef
111
 
/AF (HeiseiMin-W3H) unknowndef
112
 
/descent 130 unknowndef
113
 
/glyphshow- false unknowndef
114
 
/fss { exch *CIDFont*findresource exch scalefont setfont } bind def
115
 
/concats { % [str ...] concats str
116
 
  () exch dup length 1 sub -1 0 {
117
 
    1 index exch get dup type /stringtype ne { dup length string cvs } if
118
 
    3 -1 roll exch dup length 2 index length add string
119
 
    dup dup 4 2 roll copy length 4 -1 roll putinterval exch
120
 
  } for pop
121
 
} bind def
122
 
/composefontname { % font cmap composefontname font--cmap
123
 
  [ 2 index (--) 3 index ] concats dup 3 -1 roll [ 5 -1 roll ] composefont pop
124
 
} bind def
125
 
glyphshow- {
126
 
  /I (Identity-H) unknowndef
127
 
  /F F I composefontname def
128
 
  affix { /AF AF I composefontname def } if
129
 
  /fss { exch *findfont exch scalefont setfont } bind def
130
 
  /s 2 string def
131
 
} if
132
 
/glyphframe { % h oldx glyphframe -
133
 
  gsave 0 setlinewidth
134
 
  currentpoint pop sub exch dup 0 exch descent mul 1000 div neg rmoveto
135
 
  currentpoint 4 -2 roll rectstroke grestore
136
 
} bind def
137
 
/box { % llx lly urx ury box -
138
 
  3 index 3 index moveto exch 4 -1 roll sub 3 1 roll exch sub
139
 
  currentpoint 4 -2 roll rectstroke
140
 
} bind def
141
 
/charframe { % h string charframe -
142
 
  gsave 0 setlinewidth
143
 
  stringwidth pop exch dup 0 exch descent mul 1000 div neg rmoveto
144
 
  currentpoint 4 -2 roll rectstroke grestore
145
 
} bind def
146
 
/pathframe { % string pathframe -
147
 
  gsave 0 setlinewidth
148
 
  true charpath flattenpath pathbbox box grestore
149
 
} bind def
150
 
/np {
151
 
  /Helvetica findfont 11 scalefont setfont
152
 
  LM BM 11 2 mul sub moveto title show ( - ) show F show
153
 
  affix {
154
 
    gsave /Helvetica findfont 5 scalefont setfont ( and ) show AF show grestore
155
 
  } if
156
 
  PW RM sub BM 11 2 mul sub moveto p 3 string cvs show
157
 
  /p p 1 add def
158
 
  showpage
159
 
  /x LM def
160
 
  /y PH TM sub def
161
 
} bind def
162
 
/nb {
163
 
  /x x RW add def
164
 
  x PW RM sub ge {
165
 
    /x LM def
166
 
    /y y RH sub def
167
 
    y BM le {
168
 
      np
169
 
      /y PH TM sub def
170
 
    } if
171
 
  } if
172
 
} bind def
173
 
%%EndProlog
174
 
/x LM def
175
 
/y PH TM sub def
176
 
/p 1 def
177
 
[
178
 
  [0 6067]      % Adobe-Japan2-0
179
 
] {
180
 
  cvx exec 1 exch {
181
 
    /id exch def
182
 
    F FS fss
183
 
    x y FS sub moveto
184
 
    glyphshow- not {
185
 
      id glyphshow
186
 
      FS x glyphframe
187
 
    } {
188
 
      s 0 id 256 idiv put s 1 id 256 mod put
189
 
      FS s charframe
190
 
      s pathframe
191
 
      s show
192
 
    } ifelse
193
 
    affix {
194
 
      AF AFS fss
195
 
      x FS add y FS sub moveto
196
 
      glyphshow- not {
197
 
        id glyphshow
198
 
        AFS x FS add glyphframe
199
 
      } {
200
 
        AFS s charframe
201
 
        s pathframe
202
 
        s show
203
 
      } ifelse
204
 
    } if
205
 
    %
206
 
    /Times-Roman findfont 7 scalefont setfont
207
 
    x y FS sub FS descent mul 1000 div sub 7 sub moveto
208
 
    id 5 string cvs show
209
 
    nb
210
 
  } for
211
 
  np
212
 
} forall
213
 
%%Trailer
214
 
%%EOF