summaryrefslogtreecommitdiff
path: root/Master/xemtex/doc/ghostscript/CJK.htm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/xemtex/doc/ghostscript/CJK.htm')
-rw-r--r--Master/xemtex/doc/ghostscript/CJK.htm497
1 files changed, 497 insertions, 0 deletions
diff --git a/Master/xemtex/doc/ghostscript/CJK.htm b/Master/xemtex/doc/ghostscript/CJK.htm
new file mode 100644
index 00000000000..9833db35da4
--- /dev/null
+++ b/Master/xemtex/doc/ghostscript/CJK.htm
@@ -0,0 +1,497 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
+g/TR/html4/loose.dtd">
+<html>
+<head>
+<title>Features to support CJK CID-keyed in Ghostscript</title>
+<!-- $Id: CJK.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>Features to support CJK CID-keyed font in Ghostscript</h1>
+
+<!-- [1.1 end headline] ==================================================== -->
+
+<!-- [1.2 begin table of contents] ========================================= -->
+
+<h2>Table of contents</h2>
+
+<blockquote><ul>
+<li><a href="#Font_License">Font license</a>
+<li><a href="#About_OCF_fonts">About OCF fonts</a>
+<li><a href="#About_CID_keyed_fonts">About CID-keyed fonts</a>
+<ul>
+ <li><a href="#About_CIDFontType0">CIDFontType 0</a>
+ <li><a href="#About_CIDFontType2">CJK TrueType font and CIDFontType 2</a>
+</ul>
+<li><a href="#About_CIDFnmap">About "CIDFnmap" of Ghostscript</a>
+</ul></blockquote>
+
+<!-- [1.2 end table of contents] =========================================== -->
+
+<!-- [1.3 begin hint] ====================================================== -->
+
+<p>Impatient users looking for step-by-step installation notes for
+CJK fonts should check gs-cjk documents at
+<a href="http://www.gyve.org/gs-cjk/supplement/">
+http://www.gyve.org/gs-cjk/supplement/</a>.
+
+<!-- [1.3 end hint] ======================================================== -->
+
+<hr>
+
+<!-- [1.0 end visible header] ============================================== -->
+
+<!-- [2.0 begin contents] ================================================== -->
+
+
+
+<h2><a name="Font_license"></a>Font license</h2>
+<p>
+As we note in <a href="Fonts.htm#Add_fonts">"Adding your own fonts"</a>,
+you have to read the license of fonts carefully.
+The fact you obtain the fonts legally does not mean
+always that you can use them with Ghostscript.
+
+Usually, outline fonts for east Asian scripts are licensed under
+more restricted conditions in comparison with ASCII or Latin
+fonts, because they must provide a large number of glyphs,
+more than 8000 glyphs.
+
+For example, Adobe licenses the Asian font package for Acrobat
+Reader as "solely for Acrobat Reader". So even if your system
+have pre-installed Acrobat Reader, you cannot use its Asian fonts
+in Ghostscript.
+
+
+<h2><a name="About_OCF_fonts"></a>About OCF fonts</h2>
+<p>
+Prior to PostScript level 2015, PostScript fonts for multibyte encoded
+script (Chinese, Japanese, Korean and Vietnamese etc) were implemented
+as a collection of many elemental Type1/Type3 fonts and a selector.
+Today these fonts are known as OCF (Original Composite Font).
+Ghostscript fully supports OCF.
+
+
+<p>
+Adobe has announced that OCF is obsolete.
+For details of OCF, refer<br>
+<blockquote>
+"CJKV Information Processing" (Ken Lunde, O'Reilly 1999) p. 281,<br>
+"PostScript Language Reference Manual, third edition" p. 357
+<a
+href="http://partners.adobe.com/asn/developer/pdfs/tn/PLRM.pdf"
+class="offsite">
+href="http://partners.adobe.com/asn/developer/pdfs/tn/PLRM.pdf
+</a><br>
+"PostScript Language Tutorial and Cookbook, Japanese edition" (Adobe Systems, Incorporated, ASCII Corporation 1989) pp. 241-271,<br>
+</blockquote>
+and Technical Notes for CID-keyed fonts.
+
+
+<h2><a name="About_CID_keyed_fonts"></a>About CID-keyed fonts</h2>
+<p>
+In PostScript level 2015, Adobe introduced a new font format
+"CID-keyed font" for CJK scripts.
+For details of the CID-keyed font format, refer<br>
+<blockquote>
+"PostScript Language Reference Manual, third edition"</a> p. 364
+<a
+href="http://partners.adobe.com/asn/developer/pdfs/tn/PLRM.pdf"
+class="offsite">
+http://partners.adobe.com/asn/developer/pdfs/tn/PLRM.pdf</a><br>
+Technical Specification #5014 "Adobe CMap and CIDFont Files Specification"
+<a
+href="http://partners.adobe.com/asn/developer/pdfs/tn/5014.CMap_CIDFont_Spec.pdf"
+class="offsite">
+http://partners.adobe.com/asn/developer/pdfs/tn/5014.CMap_CIDFont_Spec.pdf
+</a><br>
+Technical Specification #5092 "CID-keyed Font Technology Overview"
+<a href="http://partners.adobe.com/asn/developer/pdfs/tn/5092.CID_Overview.pdf"
+class="offsite">
+http://partners.adobe.com/asn/developer/pdfs/tn/5092.CID_Overview.pdf
+</a><br>
+</blockquote>
+Ghostscript provides the basic functionalities of CID-keyed fonts,
+but the "rearranged font" feature is not implemented.
+The present functionalities are enough for common usage.
+Some Japanese PostScript programs expect that any system that
+supports CID-keyed fonts will also support "rearranged font".
+Such programs do not work well with ghostscript.
+Chinese and Korean scripts were never officially supplied by OCF,
+so such problems are rare.
+
+<p>
+The CID-keyed font format has a double layered structure.
+The lower layer is a CID-keyed font. The public interface of the
+CID-keyed font is a 16-bit CID (character identifier) number
+which is given to each unique "glyph" for subsets of various scripts.
+This is not a "character" code like ASCII/Unicode/etc.
+Adobe specifies CIDs for CJK scripts:
+Adobe-CNS1 &amp 2 (Traditional Chinese Hanzi glyphs),
+Adobe-GB1 (Simplified Chinese Hanzi glyphs),
+Adobe-Japan1 &amp; 2 (Japanese Kana and Kanji glyphs),
+Adobe-Korea1 &amp; 2 (Hangul and Hanja glyphs),
+Adobe-HongKong1 (Traditional Chinese Hanzi in HongKong),
+and Adobe-Vietnam1 (Chu-Han).
+The catalogues of glyphs for some CIDs are published by Adobe,
+refer Technical Notes service of Adobe:<br>
+<blockquote>
+<a
+href="http://partners.adobe.com/asn/developer/technotes/fonts.html"
+class="offsite">
+http://partners.adobe.com/asn/developer/technotes/fonts.html</a>
+</blockquote>
+
+
+
+
+<p>
+A CID-keyed font must provide the CID number interface,
+but the format of the glyph data may vary:<br>
+<ul>
+<li>CIDFontType 0 (FontType 9, CID-keyed Type1 font),</li>
+<li>CIDFontType 1 (FontType 10, CID-keyed Type3 font),</li>
+<li>CIDFontType 2 (FontType 11, CID-keyed Type42 font - TrueType)</li>
+</ul>
+
+
+
+
+
+
+<p>
+The higher layer is a CMap. A CMap provides a map from the multibyte
+character code to the CID of corresponding glyph, under a specified
+encoding system. PostScript fonts must provide a character
+code interface, so a bare CID-keyed font cannot be used as normal
+PostScript font without a CMap (e.g. <tt>findfont</tt>, <tt>show</tt>,
+etc are not usable, however <tt>glyphshow</tt> operator is usable for
+a bare CID-keyed font).
+In a CID-keyed font system, the various encoding systems can be supported
+by higher layer only. The lower layer is sharable.
+
+<p>
+A CMap file is stored in the /CMap resource category and the
+CID-keyed font file is stored in the /CIDFont resource category.
+Several operators introduced for CID-keyed fonts assume these locations,
+so CMap and CIDFont must not be stored in the /Font resource used
+traditionally used by PostScript fonts.
+
+<p>
+For "named resource category", refer
+<a href="Use.htm#PS_resources">Finding PostScript Level 2 resources</a> of Ghostscript.
+
+<p>
+Adobe distributes their official CMap (redistributable but no modification
+is permitted) on O'Reilly ftp site:
+<blockquote>
+<a
+href="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/"
+class="offsite">
+ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/</a>
+</blockquote>
+
+To use CID-keyed font, these CMap files must be installed into the CMap
+resource directory.
+
+
+
+<h3><a name="About_CIDFontType0"></a>CIDFontType 0</h2>
+<p>
+CIDFontType0 is the most standard CIDFont of PostScript.
+It consists of two separated parts: PostScript
+program and attached binary data. The glyph data is stored in attached
+binary part and is dynamically accessed. In comparison with OCF,
+loading a CIDFontType0 is light-weight and comsumes less memory.
+
+<p>
+To make Ghostscript recognize a CIDFontType0 font is easy.
+If the CIDFontType0 font file is installed into a directory named "CIDFont"
+under GenericResourceDir (see
+<a href="Use.htm#PS_resources">Finding PostScript Level 2 resources</a>),
+Ghostscript will find it when searching for resources in /CIDFont category.
+
+
+
+
+<h3><a name="About_CIDFontType2"></a>CJK TrueType font and CIDFontType 2</h2>
+<p>
+In PostScript 2010, Adobe introduced the Type42 font format
+to embed a host-based TrueType font into a PostScript program.
+For details of the Type42 font format, refer to
+<blockquote>
+The Type 42 Font Format Specification. Technical Note #5012
+<a
+href="http://partners.adobe.com/asn/developer/pdfs/tn/5012.Type42_Spec.pdf"
+class="offsite">
+"http://partners.adobe.com/asn/developer/pdfs/tn/5012.Type42_Spec.pdf
+</a>
+</blockquote>
+CIDFontType2 is a CID extension of the Type42 font format.
+If Ghostscript is compiled with
+<a href="Make.htm#Features_and_devices">ttfont device</a>
+and CMap files are installed, Ghostscript is capable of
+handling CIDFontType2 resource embedded in PostScript program
+or PDF document.
+The Type42 font specification notes that Type42 is an installable font
+format, but there's no font distributed in the Type42 format.
+This is a big difference from the standard PostScript fonts: Type1, Type3
+and CIDFontType0.
+
+<p>
+Ghostscript now provides "on-the-fly CIDFontType2 converter"
+for CJK TrueType, similar to the "on-the-fly Type42 converter" for
+Roman TrueType fonts.
+This does not mean you can perfectly substitute a required PostScript
+fonts by a TrueType font. CJK TrueType font often lack many
+non-popular glyphs and a few popular glyphs in Adobe CID.
+As a result, a TrueType font
+(designed as screen font for window system) cannot be a perfect
+replacement for an Adobe PostScript font
+Refer <a href="CJKTTCID.htm">CJKTTCID.htm</a> for further particulars.
+
+<p>
+The operator <b><tt>.openttcidfont</tt></b> constructs CIDFontType2
+font dictionary from a given TrueType font. <b><tt>.openttcidfont</tt></b>
+requires extra CMaps for PDF available from:
+
+<blockquote>
+<a
+href="http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html"
+class="offsite">
+http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html
+</a>
+</blockquote>
+
+The basic syntax of <b><tt>.openttcidfont</tt></b> is:<br>
+<blockquote>
+<b><tt>&lt;ttf_filename&gt; .openttcidfont</tt></b><br>
+</blockquote>
+
+<p>
+When a font file in Microsoft's TrueType Collection format
+(a font file with suffix <b><tt>.ttc</tt></b>
+ includes multiple fonts in single file) is given,
+the first font in it is used by default.
+To specify a font manually, index of the font should be passed
+to <b><tt>.openttcidfont</b></tt>, as:<br>
+
+<blockquote>
+<b><tt>&lt;ttc_filename&gt; 2 .openttcidfont</tt></b><br>
+</blockquote>
+
+<p>
+Old TrueType fonts were encoded by CJK-system specific encodings
+(e.g. Big5, Johab, ShiftJIS, etc) without stating what encoding
+is used.
+On the other hand, recent TrueType fonts are encoded by Unicode,
+but included glyphs are limited to specific language.
+By default, <b><tt>.openttcidfont</tt></b> detects encoding of
+TrueType font and the suitable Adobe CID automatically, but if
+you have trouble, these parameters should be specified manually.
+To specify Adobe CID and TrueType encoding explicitly, pass a name
+object as:
+
+<blockquote>
+<b><tt>&lt;ttf_filename&gt; /Adobe-Japan1-ShiftJIS .openttcidfont</tt></b><br>
+</blockquote>
+
+In such syntax, Adobe-Japan1 specifies Adobe CID to be mapped,
+and ShiftJIS specifies the encoding of TrueType fonts.
+Currently supported Adobe CIDs are:<br>
+
+<blockquote>
+<b><tt>Adobe-CNS1</tt></b><br>
+<b><tt>Adobe-GB1</tt></b><br>
+<b><tt>Adobe-Japan1</tt></b><br>
+<b><tt>Adobe-Japan2</tt></b><br>
+<b><tt>Adobe-Korea1</tt></b><br>
+</blockquote>
+
+and, supported TrueType encodings are:<br>
+
+<blockquote>
+<b><tt>Big5</tt></b><br>
+<b><tt>Johab</tt></b><br>
+<b><tt>PRC</tt></b><br>
+<b><tt>ShiftJIS</tt></b><br>
+<b><tt>Unicode</tt></b><br>
+<b><tt>Wansung</tt></b><br>
+</blockquote>
+
+In addition about on-the-fly CIDFontType2 conversion of TrueType fonts
+(of Big5, PRC, ShiftJIS, Wangsung), <tt>.openttcidfont</tt> requires
+more extra CMap files which are available from Asian font packages for
+Adobe Acrobat Reader. See <a href="Fonts.htm#CMap_Adobe"> "Adobe
+CMaps" subsection</a> of "Fonts and font facilities supplied with
+Ghostscript" section.
+
+
+
+<h2><a name="About_CIDFnmap"></a>About "CIDFnmap" of Ghostscript</h2>
+<p>
+By applying various CMap to single CIDFont, various font resources
+can be generated. To utilize this feature conveniently, "CIDFnmap"
+is introduced. CIDFnmap is similar to Fontmap, but it handles resource
+name of CIDFont.
+
+<p>
+To map all /Ryumin-Light-* fonts (/Ryumin-Light-H, /Ryumin-Light-RKSJ-H
+etc) derived from /Ryumin-Light CIDFont to those from /WadaMin-Regular,
+following single entry works enough:<br>
+
+<blockquote>
+<b><tt>/Ryumin-Light&nbsp;/WadaMin-Regular&nbsp;;</tt></b><br>
+</blockquote>
+
+Also CIDFnmap can define a resource from a file specified with full path,
+it is convenient to import resource from out of Ghostscript directory tree:<br>
+
+<blockquote>
+<b><tt>/WadaMin-Regular&nbsp;(/usr/lib/X11/fonts/CIDFont/WadaMin-Regular)&nbsp;;</tt></b><br>
+</blockquote>
+
+If the given file is TrueType font, CIDFnmap automatically detect it, and
+execute <b><tt>.openttcidfont</tt></b>:<br>
+
+<blockquote>
+<b><tt>/HG-MinchoL&nbsp;(/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf)&nbsp;;</tt></b><br>
+</blockquote>
+
+Other operands for <b><tt>.openttcidfont</tt></b> (TTC index, CID/encoding
+specification) can be specified as:<br>
+
+<blockquote>
+<b><tt>
+/HeiseiMin-W3H&nbsp;(/usr/openwin/lib/locale/ja/X11/fonts/TT/HeiseiMin-W3H.ttf)&nbsp;/Adobe-Japan2-Unicode&nbsp;;<br>
+</blockquote>
+<blockquote>
+/Ryobi-PGothic&nbsp;(/usr/X11R6/lib/X11/fonts/TrueType/tcgothb.ttc)&nbsp;2&nbsp;/Adobe-Japan1-Unicode&nbsp;;<br>
+</tt></b>
+</blockquote>
+
+
+<p>
+For detail, please refer included sample CIDFnmap. For the sites
+to get font itself, refer <a href="Fonts.htm">Fonts.htm</a>.
+
+<dl>
+<dt>CIDFnmap.Ore</dt>
+<dd>
+ For free CJK CIDFontType0 fonts manufactured by Adobe.
+</dd>
+
+<dt>CIDFnmap.Bae</dt>
+<dd>
+ For free Hangul TrueType fonts manufactured by Hwan Design Inc..
+</dd>
+
+<dt>CIDFnmap.ARP</dt>
+<dd>
+ For free Simplified/Traditional Chinese TrueType fonts
+ manifactured by Arphic Technology.
+</dd>
+
+<dt>CIDFnmap.Koc</dt>
+<dd>
+ Japanese TrueType fonts and free CIDFontType0 version of them,
+ Kochi Mincho and Gothic.
+</dd>
+
+<dt>CIDFnmap.Sol</dt>
+<dd>
+ For CJK TrueType fonts bundled on Solaris 8 International edition.
+</dd>
+
+<dt>CIDFnmap.Win</dt>
+<dd>
+ For CJK TrueType fonts bundled on Windows.
+</dd>
+
+<dt>CIDFnmap.CJK</dt>
+<dd>
+ Aliasing for printer-based CJK fonts
+ (/HYGoThic-Medium, /MSung-Light, /Ryumin-Light, /STSong-Light, etc)
+ and fallback font definitions for missing fonts in PDF.
+</dd>
+
+<dt>CIDFnmap.b5, CIDFnmap.gb, CIDFnmap.ksx, CIDFnmap.sj</dt>
+<dd>
+ Aliasing locale-specific CIDFontNames which are often required
+ with multi-byte encoding in PS/PDF files.
+</dd>
+
+</dl>
+
+
+<b>NOTE:</b>
+In gs7.2x and later release,
+"CIDFnmap" feature will be merged into new mapping feature:
+"cidfmap" and "CIDFnmap" itself will be removed.
+
+
+<p>
+There are CJK samples in <b><tt>examples/cjk</tt></b>:
+<b><tt>
+all_ac1.ps, all_ag1.ps, all_aj1.ps, all_aj2.ps, all_ak1.ps
+</tt></b>
+(drawing all glyphs in Adobe CID for Traditional Chinese,
+Simplified Chinese, Japanese, Japanese Hojo Kanji, Korean)
+<b><tt>
+gscjk_ac.ps, gscjk_ag.ps, gscjk_aj.ps, gscjk_ak.ps
+</tt></b>
+(drawing short texts in horizontal and vertical writing modes)
+and multilingual sample <b><tt>iso2022.ps</tt></b>
+(this sample loads many fonts for various scripts, quite heavy).
+<b><tt>gscjk_*</tt></b> samples are written in Asian character encoding and
+iso2022.ps is in ISO-2022, not pure ASCII.
+To modify them, an internationalized or binary capable editor
+are recommended.
+
+<p>
+For proofing by PostScript printers (for Asian market),
+these samples use standard printer-based CJK fonts:
+/HYGoThic-Medium, /MSung-Light, /Ryumin-Light, /STSong-Light etc.
+To display them correctly by Ghostscript,
+printer-based fonts must be aliased to available fonts on Ghostscript.
+CIDFnmap.CJK lists known printer-based CJK fonts,
+modify it for your own environment.
+
+
+
+
+
+<p>
+This section by Suzuki Toshiya and gs-cjk project.
+&lt;<a href="mailto:mpsuzuki@gyve.org">mpsuzuki@gyve.org</a>&gt;
+
+<!-- [2.0 end contents] ==================================================== -->
+
+<!-- [3.0 begin visible trailer] =========================================== -->
+<hr>
+
+<font size=2>
+
+<p>Copyright &copy; 2001 gs-cjk project
+&lt;<a href="http://www.gyve.org/gs-cjk/">http://www.gyve.org/gs-cjk/</a>&gt;.
+<p>Copyright &copy; 2002 artofocode 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>