summaryrefslogtreecommitdiff
path: root/Master/xemtex/doc/ghostscript/CJKTTCID.htm
blob: c777bc5b55714159fad16f0aa7a31e2ba423afc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Adobe CIDs and glyphs in CJK TrueType font</title>
<!-- $Id: CJKTTCID.htm,v 1.1.4.8.2.5 2003/05/17 14:38:59 giles Exp $ -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Adobe CIDs and glyphs in CJK TrueType font</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#Notes">Adobe CIDs that current Ghostscript can fills by CJK TTF</a></li>
<li><a href="#References">References</a></li>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

This article is written by Taiji Yamada 
&lt;<a href="mailto:taiji@aihara.co.jp">taiji@aihara.co.jp</a>&gt;.
He takes full responsibility for the wording and content of this article.

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->


<h2><a name="Overview"></a>Overview</h2>

<p>
This note provides information on utilization of CJK (Chinese,
Japanese and Korean) TrueType fonts (TTF) as CIDFoneType 2 (Type11)
CID-keyed fonts from the viewpoint of its validity and limitation.
In order to compose CIDFontType 2 font from CJK TTF on the fly,
Ghostscript uses not only standard CMaps (mapping from character
encoding to CID, we call them ToCID CMaps in following) but also
ToUnicode CMaps (mapping from CID to Unicode) and
ToCode CMaps (mapping from CID to non-Unicode character encodings)
which are freely distributed with Acrobat Reader by Adobe Systems
Incorporated.

For detail of ToUnicode CMaps, refer
<blockquote>
Adobe Systems Incorporated,
"PDF Reference, Third Edition, Version 1.4",
p. 368
<a
href="http://partners.adobe.com/asn/developer/acrosdk/docs/filefmtspecs/PDFReference.zip"
class="offsite">
http://partners.adobe.com/asn/developer/acrosdk/docs/filefmtspecs/PDFReference.zip
</a><br>
Adobe Systems Incorporated,
"ToUnicode Mapping File Tutorial",
Technical Note #5411</a><br>
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5411.ToUnicode.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5411.ToUnicode.pdf</a><br>
</blockquote>
ToUnicode and ToCode CMaps are designed for text-searching in PDF,
and you should not expect Adobe ToUnicode CMap as a one-to-one map
between Adobe glyph collection and glyph/character in Unicode.

The current algorithm of Ghostscript to map CIDs to TTF glyph ID
completely depends on Adobe CMaps, TrueType cmap and GSUB tables.

<p>
The current revision of on-the-fly CIDFontType 2 technology
supports the following kinds Registry-Ordering (RO) of CID-keyed
fonts:

<tt><pre>
	[RO]
	Adobe-CNS1
	Adobe-GB1
	Adobe-Japan1
	Adobe-Japan2
	Adobe-Korea1
</pre></tt><br>

and doesn't support the following kinds of CID-keyed fonts:<br>

<tt><pre>
	[RO]
	Adobe-CNS2
	Adobe-HongKong1
	Adobe-Korea2
	Adobe-Vietnam1
</pre></tt><br>

The current revision can handle the following kinds (Encoding in cmap
table) of TrueType fonts as CID-keyed fonts:<br>

<tt><pre>
	[Encoding]	[RO]
	Unicode		Adobe-*
	ShiftJIS	Adobe-Japan1
	PRC		Adobe-GB1
	Big5		Adobe-CNS1
	Wansung		Adobe-Korea1
	Johab		Adobe-Korea1
</pre></tt><br>

and doesn't support UCS-4 Encoding TrueType fonts for the present. In
the case of Unicode Encoding, RO can be detected by reading ``Code
Page Character Range'' of OS/2 table of TTF as follows:<br>

<tt><pre>
	[Encoding]	[Code Page]		[RO]
	Unicode		Japanese		Adobe-Japan1
			Simplified Chinese	Adobe-GB1
			Korean Wansung		Adobe-Korea1
			Traditional Chinese	Adobe-CNS1
			Korean Johab		Adobe-Korea1
</pre></tt><br>

For each combination of RO and TTF Encoding, following Adobe CMaps are
applied:<br>

<tt><pre>
	[RO-Encoding]		[Supplement limit]
		[used CMap]		- [Comment]

	Adobe-CNS1-Big5		0
		Adobe-CNS1-ETen-B5	- ToCode CMap
		ETen-B5-V		- ToCID CMap
		ETen-B5-H		- ToCID CMap

	Adobe-CNS1-Unicode	3
		Adobe-CNS1-UCS2		- ToUnicode CMap
		UniCNS-UCS2-V		- ToCID CMap
		UniCNS-UCS2-H		- ToCID CMap

	Adobe-GB1-PRC		2
		Adobe-GB1-GBK-EUC	- ToCode CMap
		GBK-EUC-V		- ToCID CMap
		GBK-EUC-H		- ToCID CMap

	Adobe-GB1-Unicode	4
		Adobe-GB1-UCS2		- ToUnicode CMap
		UniGB-UCS2-V		- ToCID CMap
		UniGB-UCS2-H		- ToCID CMap

	Adobe-Japan1-ShiftJIS	2
		Adobe-Japan1-90ms-RKSJ	- ToCode CMap
		90ms-RKSJ-V		- ToCID CMap
		90ms-RKSJ-H		- ToCID CMap

	Adobe-Japan1-Unicode	4
		Adobe-Japan1-UCS2	- ToUnicode CMap
		UniJIS-UCS2-V		- ToCID CMap
		UniJIS-UCS2-H		- ToCID CMap

	Adobe-Japan2-Unicode	0
		UniHojo-UCS2-V		- ToCID CMap
		UniHojo-UCS2-H		- ToCID CMap

	Adobe-Korea1-Johab	1
		KSC-Johab-V		- ToCID CMap
		KSC-Johab-H		- ToCID CMap

	Adobe-Korea1-Unicode	2
		Adobe-Korea1-UCS2	- ToUnicode CMap
		UniKS-UCS2-V		- ToCID CMap
		UniKS-UCS2-H		- ToCID CMap

	Adobe-Korea1-Wansung	1
		Adobe-Korea1-KSCms-UHC	- ToCode CMap
		KSCms-UHC-V		- ToCID CMap
		KSCms-UHC-H		- ToCID CMap
</pre></tt><br>

where Supplement values are denoted as the limit determined by the
maximum CID in used CMaps.

<p>
The Glyph Substitution table (GSUB) of TTF, Single Substitution Format
2 is read for vertically-used glyphs in CIDs. The current revision
doesn't handle any other formats of GSUB, so handling ligatures and
variants as CID-keyed fonts might be tasks to be solved in future.

<p>
In recent CID-keyed fonts, pre-rotated Latin glyphs are defined, but
the current revision merely maps to normal Latin glyphs.
Ghostscript cannot handle them at present.

<h2><a name="Notes"></a>
Adobe CIDs that current Ghostscript can fills by CJK TTF</h2>
<p>
Following tables and comments provide the details of validity and
limitation for the individual kinds of CID-keyed fonts composed from
generally-circulated and Unicode TrueType fonts at the current
revision. Naturally, these results of glyphs lacking are affected by
TrueType fonts you use.<br>

<tt><pre>
Adobe-CNS1 CID-keyed font composed from Traditional Chinese Unicode TTF
-----------------------------------------------------------------------
[ROS]		[CID range]	[Comment]
Adobe-CNS1-0	    0-  505	96,97,124-127,228,260 are lacking
		  506-  561	no problem
		  562-  594	all glyphs are lacking
		  595-13645	no problem
		13646-13748	13646,13647 are lacking
		13749-13998	13996-13998 are lacking
		13999-14098	some glyphs are lacking
Adobe-CNS1-1	14099-17407	lots of glyphs are lacking (*1)
Adobe-CNS1-2	17408-17600	17503,17504 are lacking (*2)
Adobe-CNS1-3	17601-17605	17603 is lacking
		17606-18845	lots of glyphs are lacking (*3)
Adobe-CNS1-4	18846-18961	all glyphs assignment is impossible (*4)
(*1) HK GCCS
(*2) not pre-rotated
(*3) HK SCS
(*4) HK SCS (unused in UniCNS-UCS-2 CMap, though used in UniCNS-UTF8,
UniCNS-UTF16, UniCNS-UTF32, also ETHK-B5, needless to say HKscs-B5)


Adobe-GB1 CID-keyed font composed from Simplified Chinese Unicode TTF
---------------------------------------------------------------------
[ROS]		[CID range]	[Comment]
Adobe-GB1-0	    0-  939	99,695,698,737,935,938 are lacking
		  940- 7702	no problem
		 7703- 7716	7705,7708 are incorrect
Adobe-GB1-1	 7717- 9896	no problem
Adobe-GB1-2	 9897-22126	no problem
Adobe-GB1-3	22127-22352	22347,22350,22352 are lacking (*1)
Adobe-GB1-4	22353-22427	all glyphs are not available (*2)
		22428-29058	all glyphs are not available (*3)
		29059-29063	all glyphs are not available (*4)
(*1) not pre-rotated
(*2) additional Hiragana and Katakana, extended Bopomofo glyphs
(*3) the Unified Han Ideographs Extension A
(*4) pre-rotated glyphs


Adobe-Japan1 CID-keyed font composed from Japanese Unicode TTF
--------------------------------------------------------------
[ROS]		[CID range]	[Comment]
Adobe-Japan1-0	    0- 1124	lots of glyphs are lacking or incorrect:
				96-98,127,128,130-133,135-137,226,326,
				390,396,422,424,502,506-509,512,513,515,
				606,607,632
		 1125- 7477	no problem
		 7478- 7632	7478 is lacking and 7608,7609 are incorrect
		 7633- 8004	lots of glyphs are lacking or incorrect (*4)
		 8005- 8283	lots of glyphs are lacking or incorrect:
				8008,8053,8059-8061,8091,8102-8111,8166-8181,
				8189,8190,8227-8229,8260
Adobe-Japan1-1	 8284- 8358	lots of glyphs are lacking or incorrect:
				8295-8297,8300-8302,
				8306,8307,8321,8322,8325,8326
Adobe-Japan1-2	 8359- 8717	no problem
		 8718- 8719	8718 is lacking and 8719 is incorrect
Adobe-Japan1-3	 8720- 9353	some glyphs are lacking or incorrect (*1)
Adobe-Japan1-4	 9354- 9737	some glyphs are lacking or incorrect (*2)
		 9738-13319 	lots of glyphs are lacking or incorrect (*3)
		13320-15443	all glyphs are variants or lacking (*4)
(*1) not pre-rotated
(*2) not italic form
(*3) many ligature, pre-rotated, pre-rotated and italic form glyphs
(*4) lots of variants are assigned substitutes


Adobe-Japan2 CID-keyed font composed from Japanese Unicode TTF
--------------------------------------------------------------
[ROS]		[CID range]	[Comment]
Adobe-Japan2-0	    0- 6067	no problem


Adobe-Korea1 CID-keyed font composed from Korean Unicode TTF
------------------------------------------------------------
[ROS]		[CID range]	[Comment]
Adobe-Korea1-0	    0-  357	some glyphs are lacking or incorrect:
				61,97,100,104,111,227
		  358- 3435	no problem
		 3436- 8055	no problem
		 8056- 8190	lots of glyphs are lacking or incorrect:
				8059,8061,8075,8083-8085,8089,8091,8093,8190
		 8191- 9332	no problem
Adobe-Korea1-1	 9333-18154	perhaps no problem, but cannot check (*)
Adobe-Korea1-2	18155-18351	some glyphs are lacking
(*) Technical Note on Adobe-Korea1-1,2 has not been published yet[6].
</pre></tt>

<p>
The current mapping algorithm based on ToCID CMaps and ToUnicode
CMaps still has problems. The gs-cjk project[7] is considering how
to settle the matters.


<h2><a name="References"></a>References</h2>
<ol>
<li>Microsoft Corporation, "OpenType specification"
<a
href="http://www.asia.microsoft.com/typography/otspec/"
class="offsite">
http://www.asia.microsoft.com/typography/otspec/</a>
</li>

<li>
Adobe Systems Incorporated,
"Adobe-CNS1-4 Character Collection for CID-Keyed Fonts",
Technical Note #5080
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5080.Adobe-CNS1-4.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5080.Adobe-CNS1-4.pdf</a>
</li>

<li>
Adobe Systems Incorporated,
"Adobe-GB1-4 Character Collection for CID-Keyed Fonts",
Technical Note #5079
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5079.Adobe-GB1-4.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5079.Adobe-GB1-4.pdf</a>
</li>

<li>
Adobe Systems Incorporated,
"Adobe-Japan1-4 Character Collection for CID-Keyed Fonts",
Technical Note #5078
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5078.Adobe-Japan1-4.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5078.Adobe-Japan1-4.pdf
</a>
</li>

<li>
Adobe Systems Incorporated,
"Adobe-Japan2-0 Character Collection for CID-Keyed Fonts",
Technical Note #5097
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5097.Adobe-Japan2-0.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5097.Adobe-Japan2-0.pdf
</a>
</li>

<li>
Adobe Systems Incorporated,
"Adobe-Korea1-0 Character Collection for CID-Keyed Fonts"
Technical Note #5093
<a
href="http://partners.adobe.com/asn/developer/pdfs/tn/5093.Adobe-Korea1-0.pdf"
class="offsite">
http://partners.adobe.com/asn/developer/pdfs/tn/5093.Adobe-Korea1-0.pdf
</a>
</li>

<li>
Taiji Yamada, "Tips on PostScript"
<a href="http://www.aihara.co.jp/~taiji/tops/" class="offsite">
http://www.aihara.co.jp/~taiji/tops/</a></li>

<li>"gs-cjk project"
<a href="http://www.gyve.org/gs-cjk/" class="offsite">
http://www.gyve.org/gs-cjk/</a></li>
</ol>


<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<font size=2>

<p>Copyright &copy; 2001 Taiji Yamada &lt;<a href="mailto:taiji@aihara.co.jp">taiji@aihara.co.jp</a>&gt; and
<a href="http://www.gyve.org/gs-cjk/" class="offsite">gs-cjk project</a>.
<p>Copyright &copy; 2002 artofcode LLC. All rights reserved.

<p>This file is part of GNU Ghostscript.  See the
<a href="COPYING">GNU General Public License</a> (the "License") for
full details of the terms of using, copying, modifying, and redistributing
GNU Ghostscript.

<p>
<small>Ghostscript version 7.07, 17 May 2003

</font>

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>