1%!
2% Copyright (C) 2001 Masatake YAMATO, Taiji Yamada and gs-cjk project
3%
4% This file is part of GNU Ghostscript.
5%
6% GNU Ghostscript is distributed in the hope that it will be useful, but
7% WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
8% to anyone for the consequences of using it or for whether it serves any
9% particular purpose or works at all, unless he says so in writing. Refer
10% to the GNU General Public License for full details.
11%
12% Everyone is granted permission to copy, modify and redistribute GNU
13% Ghostscript, but only under the conditions described in the GNU General
14% Public License.  A copy of this license is supposed to have been given
15% to you along with GNU Ghostscript so you can know your rights and
16% responsibilities.  It should be in a file named COPYING.  Among other
17% things, the copyright notice and this notice must be preserved on all
18% copies.
19
20% $Id: CIDFnmap,v 1.1.4.1 2002/04/02 14:47:42 mpsuzuki Exp $
21% CIDFnmap - sample CID-keyed font catalog for Ghostscript.
22
23% ----------------------------------------------------------------
24
25% This file is a catalog of CID-keyed fonts, TrueType fonts (TTF), and also
26% TrueType Collection fonts (TTC) known to Ghostscript.
27%
28% There are two ways to make a CID-keyed font loaded automatically when named:
29% C1. Put the CID-keyed font as a resource file to /Resource/CIDFont(*1).
30%    (*1) A path concatenated with GenericResourceDir defined in
31%        gs_res.ps and "CIDFont". The default value of GenericResourceDir
32%        is "/Resource/".
33% C2. Put the CID-keyed font file to Ghostscript's font path(*2)
34%    and write an entry for the CID-keyed font to this catalog.
35%    (*2) Somewhere in Ghostscript font search path, which is generally
36%        /usr/local/share/ghostscript/fonts. See output of `gs -h` or Use.htm,
37%        Ghostscript's document.
38%
39% There are two ways to make a TrueType font loaded automatically when named:
40% T1. Write a wrapper script file for the TrueType font and put the
41%    wrapper file to /Resource/CIDFont. The wrapper has to translate a
42%    TrueType font file to Type 2 CID-keyed on demand. Some examples of the
43%    wrapper file named "CIDFontName" as follows:
44%
45%	(e1) TTF translated to Type 2 CID-keyed font
46%	%!PS-Adobe-3.0 Resource-CIDFont
47%	%%BeginResource: CIDFont (CIDFontName)
48%	/CIDFontName (filename.ttf) .openttcidfont
49%	dup length dict begin {def} forall currentdict end
50%	/CIDFont defineresource pop
51%	%%EndResource
52%	%%EOF
53%
54%	(e2) TTC with an index translated to Type 2 CID-keyed font
55%	%!PS-Adobe-3.0 Resource-CIDFont
56%	%%BeginResource: CIDFont (CIDFontName)
57%	/CIDFontName (filename.ttc) 2 .openttcidfont
58%	dup length dict begin {def} forall currentdict end
59%	/CIDFont defineresource pop
60%	%%EndResource
61%	%%EOF
62%
63%	(e3) TTC with an index and a name of RO(Registry-Ordering)-Code
64%	%!PS-Adobe-3.0 Resource-CIDFont
65%	%%BeginResource: CIDFont (CIDFontName)
66%	/CIDFontName (filename.ttc) 2 /Adobe-GB1-Unicode .openttcidfont
67%	dup length dict begin {def} forall currentdict end
68%	/CIDFont defineresource pop
69%	%%EndResource
70%	%%EOF
71%
72%    for details about the names of RO-Code written in (e3), see below.
73%
74% T2. Put the CID-keyed font file to Ghostscript's font path(*2)
75%    and write an entry for the TrueType font to this catalog.
76
77% The Syntax of CIDFnmap is very similar to Fontmap.
78% Each CID-keyed font has an entry consisting of three items:
79%
80%	i1. The name by which the CID-keyed font is known inside Ghostscript
81%	(a Ghostscript name preceded by a `/', or a string enclosed
82%	in parentheses).  This is used to find the file from which
83%	a font of a given name should be loaded.
84%
85%	i2. Information depending on whether this is a real CID-keyed font or a
86%	CID-keyed font alias:
87%
88%		- For real CID-keyed fonts, the name of the CID-keyed font
89%		file (a Ghostscript string, enclosed in parentheses).
90%		The filename should include the extension if the CID-keyed font
91%		 name has.
92%
93%		- For CID-keyed font aliases, the name of the CID font
94%		which should be used when this one is requested,
95%		preceded by a `/'. Note that an alias name cannot be enclosed
96%		in parentheses.
97%
98%	i3. At least one space or tab, and a terminating semicolon.
99%
100% Each CID-keyed font has an entry consisting of three essential items and
101% two optional items. The three essential items are the same to the items of
102% CID-keyed Font. Two optional items are put between i2 and i3.
103% Two optional items are:
104%
105%	i4. the number that specifies TTC font index
106%
107%       i5. the name of CIDs mapping to Codes
108%         ``The kind of CIDs mapping to Codes'' is listed as follows:
109%
110%	<RO-Code>		<Comment>
111%	/Adobe-CNS1-Big5	Traditional Chinese, for Big5 TrueType fonts
112%	/Adobe-CNS1-Unicode	Traditional Chinese, for Unicode TrueType fonts
113%	/Adobe-CNS1		Traditional Chinese, for TrueType fonts (*3)
114%	/Adobe-GB1-PRC		Simplified Chinese, for PRC TrueType fonts
115%	/Adobe-GB1-Unicode	Simplified Chinese, for Unicode TrueType fonts
116%	/Adobe-GB1		Simplified Chinese, for TrueType fonts (*3)
117%	/Adobe-Japan1-ShiftJIS	Japanese, for ShiftJIS TrueType fonts
118%	/Adobe-Japan1-Unicode	Japanese, for Unicode TrueType fonts
119%	/Adobe-Japan1		Japanese, for TrueType fonts (*3)
120%	/Adobe-Japan2-Unicode	JIS Supplement, for Unicode TrueType fonts
121%	/Adobe-Japan2		JIS Supplement, for TrueType fonts (*3)
122%	/Adobe-Korea1-Johab	Korean, for Johab TrueType fonts
123%	/Adobe-Korea1-Unicode	Korean, for Unicode TrueType fonts
124%	/Adobe-Korea1-Wansung	Korean, for Wansung TrueType fonts
125%	/Adobe-Korea1		Korean, for TrueType fonts (*3)
126%	(*3) Code is automatically detected by cmap table of a TrueType file.
127%       If an optional item for the kind of mapping is omitted, then
128%       Code of TTF and RO(Registry-Ordering) of CIDFont are automatically
129%       detected by OS/2 table and cmap table of TTF, respectively.
130
131% Like Fontmap, .runlibfile is used in CIDFnmap to include other CIDFnmaps.
132
133% The following table is actually a Ghostscript data structure.
134% If you add new entries, be sure to copy the punctuation accurately;
135% in particular, you must leave at least one space or tab between each
136% field in the entry.
137
138%(CIDFnmap.Ore) .runlibfile
139%(CIDFnmap.ARP) .runlibfile
140%(CIDFnmap.Bae) .runlibfile
141%(CIDFnmap.Koc) .runlibfile
142%(CIDFnmap.Sol) .runlibfile
143%(CIDFnmap.Win) .runlibfile
144
145%(CIDFnmap.CJK) .runlibfile
146
147% native CIDFontName (BIG5) in traditional Chinese
148%(CIDFnmap.b5) .runlibfile
149
150% native CIDFontName (GB2312) in simplified Chinese
151%(CIDFnmap.gb) .runlibfile
152
153% native CIDFontName (Shift_JIS) in Japanese
154%(CIDFnmap.sj) .runlibfile
155
156% native CIDFontName (euc-kr) in Korean
157%(CIDFnmap.ksx) .runlibfile
158