Improve documentation for CID fonts

"Russell Lang" <[email protected]> Tue, 26 Oct 2004 12:10:45 +1000
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <417E3EC5.705.5AA5155@localhost>
These changes show my understanding of how GS supports CID fonts.  Igor should 
check that the documentation is correct.

Log message:
Improve documentation for CID fonts.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  cjkdoc1.txt
     Date:  26 Oct 2004, 12:00
     Size:  8220 bytes.
     Type:  Text

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
cjkdoc1.txt (application/octet-stream, 7.8 KB)
diff -u /cvs/gs/doc/Use.htm doc/Use.htm
--- /cvs/gs/doc/Use.htm	Wed Sep 15 01:14:26 2004
+++ doc/Use.htm	Tue Oct 26 01:59:04 2004
@@ -50,9 +50,10 @@
 <ul>
 <li><a href="#PS_resources">Finding PostScript Level 2 resources</a>
 <li><a href="#Font_lookup">Font lookup</a>
+<li><a href="#CIDFonts">CID fonts</a>
+<li><a href="#CIDFontSubstitution">CID font substitution</a>
 <li><a href="#Temp_files">Temporary files</a>
 </ul>
-<li><a href="#CIDFontSubstitution">CID font substitution</a>
 
 <li><a href="#Platforms">Notes on specific platforms</a>
 <ul>
@@ -880,9 +881,7 @@
 </ul>
 
 <p>
-Loading truetype fonts directly from <tt>/Resource/CIDFont/</tt> is not
-supported. A <a href="#CIDFontSubstitution"><tt>cidfmap</tt></a> entry
-must be created instead to provide a proper character ordering for the font.
+<a href="#CIDFonts">CID fonts</a> use a different method from the above.
 
 <blockquote><table cellpadding=0 cellspacing=0>
 <tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Differences between search path and font path</font><hr>
@@ -1035,43 +1034,7 @@
 about a megabyte of disk space, but the installation documentation explains
 how to do it <a href="Install.htm#Use_Acrobat_fonts_Unix">on Unix</a>.
 
-<h3><a name="Temp_files"></a>Temporary files</h3>
-
-<blockquote><table cellpadding=0 cellspacing=0>
-<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Where Ghostscript puts temporary files</font><hr>
-<tr valign=bottom>
-	<th align=left>Platform
-	<td>&nbsp;&nbsp;&nbsp;
-	<th align=left>Filename
-	<td>&nbsp;&nbsp;&nbsp;
-	<th align=left>Location
-<tr>	<td colspan=5><hr>
-<tr valign=top>	<td>MS Windows and OpenVMS
-	<td>&nbsp;
-	<td><b><tt>_temp_</tt></b>XX.XXX
-	<td>&nbsp;
-	<td>Current directory
-<tr valign=top>	<td>OS/2
-	<td>&nbsp;
-	<td><b><tt>gs</tt></b>XXXXXX
-	<td>&nbsp;
-	<td>Current directory
-<tr valign=top>	<td>Unix
-	<td>&nbsp;
-	<td><b><tt>gs_</tt></b>XXXXX
-	<td>&nbsp;
-	<td><b><tt>/tmp</tt></b>
-</table></blockquote>
-
-<p>
-You can change in which directory Ghostscript creates temporary files by
-setting the <b><tt>TMPDIR</tt></b> or <b><tt>TEMP</tt></b> environment
-variable to the name of the directory you want used.  Ghostscript currently
-doesn't do a very good job of deleting temporary files if it exits because
-of an error; you may have to delete them manually from time to time.
-
-<h2><a name="CIDFontSubstitution"></a>CID font substitution</h2>
-
+<h3><a name="CIDFonts"></a>CID fonts (typically Chinese, Japanese and Korean)</h3>
 <p>
 CID fonts are PostScript resources containing
 large number of glyphs (e.g. glyphs for Far East languages).
@@ -1099,6 +1062,18 @@
 Another method is possible using the <b><tt>composefont</tt></b> operator.
 
 <p>
+CID fonts must be placed in the <b><tt>/Resource/CIDFont/</tt></b> directory.
+They are not found using <a href="#Font_lookup">Font lookup</a> 
+on the search path or font path.
+
+<p>
+Loading truetype fonts directly from <b><tt>/Resource/CIDFont/</tt></b> is not
+supported. A <a href="#CIDFontSubstitution">CID font substitution</a> must 
+be created instead to provide a proper character ordering for the font.
+
+<h3><a name="CIDFontSubstitution"></a>CID font substitution</h3>
+
+<p>
 For substituting CID font resources Ghostscript provides the control file
 <b><tt>lib/cidfmap</tt></b>, which defines a CID font resource map.
 The file forms a table of records, each of which should use one of two formats,
@@ -1121,10 +1096,11 @@
 
 <p>
 
-For substituting a TrueType font to a CID font one should use format like this :
+For substituting a TrueType font to a CID font resource one should use 
+format like this :
 
 <blockquote><b><tt>
-/Substituted << keys&values >> ;
+/Substituted &lt;&lt; keys&values &gt;&gt; ;
 </tt></b></blockquote>
 
 Where <b><tt>keys&values</tt></b> are explained in the table below.
@@ -1134,18 +1110,19 @@
 <tr>	<th>Key
 	<th>Type
 	<th>Description
-<tr>	<td><tt>/Path</tt>
+<tr>	<td><b><tt>/Path</tt></b>
         <td>string
-        <td>A path to a TrueType font file.
-<tr>	<td><tt>/FileType</tt>
+        <td>A path to a TrueType font file.  This must be an absolute path.
+<tr>	<td><b><tt>/FileType</tt></b>
         <td>name
         <td>Must be <b><tt>/TrueType</tt></b>.
-<tr>	<td><tt>/SubfontID</tt>
+<tr>	<td><b><tt>/SubfontID</tt></b>
         <td>integer
         <td>(optional) Index of the font in font collection, such as TTC.
             This is ignored if Path doesn't specify a collection.
+            The first font in a collection is 1.
             Default value is 0.
-<tr>	<td><tt>/CSI</tt>
+<tr>	<td><b><tt>/CSI</tt></b>
         <td>array of 2 elements
         <td>(required) Information for building <b><tt>CIDSystemInfo</tt></b>.
             The first element is a string, which specifies <b><tt>Ordering</tt></b>.
@@ -1154,7 +1131,7 @@
 
 <p>
 Currently only CIDFontType 2 can be emulated with a TrueType font.
-The TrueType font must contain enough charasters to cover an
+The TrueType font must contain enough characters to cover an
 Adobe character collection, which is specified in <b><tt>Ordering</tt></b>.
 
 <p>
@@ -1162,19 +1139,67 @@
 
 
 <blockquote><b><tt>
-/Ryumin-Medium  /ShinGo-Bold ;
-</tt></b></blockquote>
-<blockquote><b><tt>
-/Ryumin-Light   << /FileType /TrueType /Path (F:/WIN2000/Fonts/ARIALUNI.TTF) /SubfontID 3 /CSI [(Japan1) 2] >> ;
-</tt></b></blockquote>
+/Ryumin-Medium  /ShinGo-Bold ;<br>
+/Ryumin-Light   &lt;&lt; /FileType /TrueType /Path (F:/WIN2000/Fonts/ARIALUNI.TTF) /SubfontID 3 /CSI [(Japan1) 2] &gt;&gt; ;<br>
+<br>
+/Batang &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/batang.ttc) /SubfontID 1 /CSI [(Korea1) 3] &gt;&gt; ;<br>
+/Gulim &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 1 /CSI [(Korea1) 3] &gt;&gt; ;<br>
+/Dotum &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 3 /CSI [(Korea1) 3] &gt;&gt; ;<br>
+/HYSMyeongJo-Medium /Batang ;<br>
+/HYRGoThic-Medium /Gulim ;<br>
+/HYGoThic-Medium /Dotum ;<br>
+<br>
+/SimSun &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /SubfontID 1 /CSI [(GB1) 2] &gt;&gt; ;<br>
+/SimHei &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simhei.ttf) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
+/STSong-Light /SimSun ;<br>
+/STHeiti-Regular /SimHei ;<br>
+
+</tt></b>
+</blockquote>
+
 
 <p>
-Note that loading truetype fonts directly from /Resources/CIDFont is no longer
+Note that loading truetype fonts directly from <b><tt>/Resource/CIDFont/</tt></b> is no longer
 supported. There is no reliable way to generate a character ordering for truetype
 fonts. The 7.0x versions of Ghostscript supported this by assuming a Japanese
 character ordering. This is replaced in the 8.0x and later releases with the more
 general <b><tt>cidfmap</tt></b> mechanism.
 
+<h3><a name="Temp_files"></a>Temporary files</h3>
+
+<blockquote><table cellpadding=0 cellspacing=0>
+<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Where Ghostscript puts temporary files</font><hr>
+<tr valign=bottom>
+	<th align=left>Platform
+	<td>&nbsp;&nbsp;&nbsp;
+	<th align=left>Filename
+	<td>&nbsp;&nbsp;&nbsp;
+	<th align=left>Location
+<tr>	<td colspan=5><hr>
+<tr valign=top>	<td>MS Windows and OpenVMS
+	<td>&nbsp;
+	<td><b><tt>_temp_</tt></b>XX.XXX
+	<td>&nbsp;
+	<td>Current directory
+<tr valign=top>	<td>OS/2
+	<td>&nbsp;
+	<td><b><tt>gs</tt></b>XXXXXX
+	<td>&nbsp;
+	<td>Current directory
+<tr valign=top>	<td>Unix
+	<td>&nbsp;
+	<td><b><tt>gs_</tt></b>XXXXX
+	<td>&nbsp;
+	<td><b><tt>/tmp</tt></b>
+</table></blockquote>
+
+<p>
+You can change in which directory Ghostscript creates temporary files by
+setting the <b><tt>TMPDIR</tt></b> or <b><tt>TEMP</tt></b> environment
+variable to the name of the directory you want used.  Ghostscript currently
+doesn't do a very good job of deleting temporary files if it exits because
+of an error; you may have to delete them manually from time to time.
+
 <hr>
 
 <h2><a name="Platforms"></a>Notes on specific platforms</h2>