~ubuntu-branches/ubuntu/intrepid/ghostscript/intrepid-updates

« back to all changes in this revision

Viewing changes to examples/cjk/gscjk_ac.ps

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-08-13 21:49:58 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070813214958-ro9nbb3fmvzlr7q3
Tags: 8.61.dfsg.1~svn8187-0ubuntu1
New upstream release
o SVN snapshot rev 8187
o CJK patches from Koji Otani to fix several issues with CJK text
(should fix http://bugs.ghostscript.com/show_bug.cgi?id=689304).
These patches were also applied to ESP Ghostscript and having them
in Gutsy's GPL GS will avoide regressions against Feisty's ESP GS.
o Minor bug fixes from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%!PS-Adobe-3.0
 
2
%%Title: chinese-big5 encoding
 
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
%%BoundingBox: 30 150 530 650
 
9
%%EndComments
 
10
%%BeginProlog
 
11
 
 
12
/*gs-cjk (\
 
13
------------------------------------------------------------------------\n\
 
14
This is a script to test CJK fonts such as CID-keyed fonts.\n\
 
15
If you have not done CID-keyed fonts installation and definitions at\n\
 
16
/Resource/CMap and CIDFnmap or /Resource/CIDFont of ghostscript, then\n\
 
17
this script can't work correctly.\n\
 
18
For details, please see README at http://www.gyve.org/gs-cjk/supplement.\n\
 
19
 
 
20
If you throw this script into a printer, it requires PostScript 3\n\
 
21
printer and CID-keyed fonts specified in this script.\n\
 
22
------------------------------------------------------------------------\n) def
 
23
 
 
24
/notice*stdout 4 dict begin
 
25
  /*open {} def /*echo-n { =only } def /*echo { = } def /*close { flush } def
 
26
  currentdict
 
27
end def
 
28
 
 
29
/notice*page 5 dict begin
 
30
  /*y 750 def
 
31
  /*open {
 
32
    gsave initmatrix /Courier findfont 11 scalefont setfont 50 *y moveto
 
33
    *y 750 eq {
 
34
      *gs-cjk { (\n) search { *echo } { *echo-n exit } ifelse pop } loop
 
35
    } if
 
36
  } def
 
37
  /*echo-n { dup type /stringtype ne { dup length string cvs } if show } def
 
38
  /*echo { *echo-n /*y *y 11 sub def 50 *y moveto } def
 
39
  /*close { grestore } def
 
40
  currentdict
 
41
end def
 
42
 
 
43
/greeting*gs-cjk {
 
44
  product (Ghostscript) search not { pop } { pop pop pop QUIET not {
 
45
    notice*stdout begin
 
46
      *open
 
47
      *gs-cjk { (\n) search { *echo } { *echo-n exit } ifelse pop } loop
 
48
      *close
 
49
    end
 
50
  } if } ifelse
 
51
} bind def
 
52
greeting*gs-cjk
 
53
 
 
54
/*findfont {
 
55
  dup /Font resourcestatus { pop pop findfont } {
 
56
    notice*page begin
 
57
      *open
 
58
      (Error in findfont: ) *echo-n dup *echo
 
59
      *close
 
60
    end
 
61
    findfont
 
62
  } ifelse
 
63
} bind def
 
64
 
 
65
/orighandleerror errordict /handleerror get def
 
66
errordict begin
 
67
  /handleerror {
 
68
    notice*page begin errordict begin $error begin
 
69
      *open
 
70
      (Error of ) *echo-n errorname dup length string cvs *echo
 
71
      *close
 
72
      showpage
 
73
    end end end
 
74
    orighandleerror
 
75
  } bind def
 
76
end
 
77
%%EndProlog
 
78
/MSung-Light--B5-V *findfont 25 scalefont setfont
 
79
500 625 moveto
 
80
(�F�������c��r���g�L��) show
 
81
/MSung-Light--B5-H *findfont 25 scalefont setfont
 
82
50 600 moveto
 
83
(�F�� Ghostscript) show
 
84
50 550 moveto
 
85
(�����c��r Traditional Chinese) show
 
86
50 500 moveto
 
87
(��g horizontal writing) show
 
88
50 450 moveto
 
89
(�L�� Print) show
 
90
%
 
91
/MSung-Light--B5-V *findfont [ 1 .3 0 1 0 0 ] makefont 20 scalefont setfont
 
92
100 275 moveto 20 2 div 0 rmoveto
 
93
(����) dup stringwidth neg rmoveto show
 
94
/MSung-Light--B5-H *findfont [ 1 0 .3 1 0 0 ] makefont 20 scalefont setfont
 
95
100 250 moveto
 
96
(���� Italic transformation) show
 
97
%
 
98
/MSung-Light--B5-H *findfont 20 scalefont setfont
 
99
150 400 moveto
 
100
(Sung Typeface ����) show
 
101
/MSung-Medium--B5-H *findfont 20 scalefont setfont
 
102
150 375 moveto
 
103
(Sung Medium Typeface ������) show
 
104
/MHei-Medium--B5-H *findfont 20 scalefont setfont
 
105
150 350 moveto
 
106
(Hei Typeface ����) show
 
107
/MKai-Medium--B5-H *findfont 20 scalefont setfont
 
108
150 325 moveto
 
109
(Kai Typeface �{��) show
 
110
%
 
111
/Times-Roman findfont 13 scalefont setfont
 
112
50 200 moveto
 
113
(* Chinese translation of "Ghostscript" is merely associative \
 
114
characters of these meanings.) show
 
115
50 200 13 sub moveto
 
116
(In Traditional Chinese articles, customarily we use just \
 
117
"Ghostscript" as it is.) show
 
118
showpage
 
119
%%Trailer
 
120
%%EOF