⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fonts.htm

📁 GhostScript的源代码
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<html>
<head>
<title>Fonts and font facilities supplied with Ghostscript</title>
<!-- $Id: Fonts.htm $ -->
<!-- Originally: fonts.txt -->
</head>

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

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

<p><table width="100%" border="0">
<tr><th align="center" bgcolor="#CCCC00"><font size=6>
Fonts and font facilities<br>supplied with Ghostscript
</font>
</table>

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

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

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#About">About Ghostscript fonts</a>
<li><a href="#Free_fonts">Ghostscript's free fonts</a>
<li><a href="#Other_fonts">Other free fonts</a>
<ul>
<li><a href="#Chinese_font">A free Chinese (Hanzi) font</a>
<li><a href="#Japanese">Free Japanese (Kanji) fonts</a>
<li><a href="#Unicode_CMaps">Unicode CMaps</a>
<li><a href="#Cyrillic">Free Cyrillic fonts</a>
</ul>
<li><a href="#Get_fonts">How Ghostscript gets fonts when it runs</a>
<li><a href="#Platform_fonts">Platform fonts</a>
<li><a href="#Add_fonts">Adding your own fonts</a>
<ul>
<li><a href="#Convert_BDF">Converting BDF fonts</a>
</ul>
<li><a href="#For_developers">For developers only</a>
<ul>
<li><a href="#Font_contents">Contents of fonts</a>
<li><a href="#Precompiling">Precompiling fonts</a>
<li><a href="#Short_identifiers">Precompiling fonts on platforms with identifier length limits</a>
<li><a href="#Unique_IDs">Font names and unique IDs</a>
<li><a href="#Codes">Codes used to make font file names</a>
</ul>
</ul></blockquote>

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

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

<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="About"></a>About Ghostscript fonts</h2>

<p>
Ghostscript is distributed with two kinds of files related to fonts:

<ul>
<li>the fonts themselves in individual files, and
<li>a file "<tt><b>Fontmap</b></tt>" that defines for
Ghostscript which file represents which font.
</ul>

<p>
Most of the font files supplied with Ghostscript have the extension
<tt><b>.pfb</b></tt>, and a few have <tt><b>.pfa</b></tt> or
<tt><b>.gsf</b></tt>.  Each file defines one ordinary PostScript Type 1
outline font which any PostScript language interpreter can use.  Files with
<tt><b>.pfa</b></tt> or <tt><b>.pfb</b></tt> extensions are also compatible
with Adobe Type Manager (ATM) and with tools that don't include a full
PostScript language interpreter; files with <tt><b>.gsf</b></tt> extension
are incompatible with ATM and other tools. Ghostscript compiled with the
"ttfont" option can also use TrueType fonts with the extension
<tt><b>.ttf</b></tt>.

<p><a name="Fontmap"></a>
When Ghostscript needs a font, it must have some way to know where to look
for it: that's the purpose of the <b><tt>Fontmap</tt></b> file, which
associates the names of <em>fonts</em> such as <b><tt>/Times-Roman</tt></b>
with the names of font <em>files</em>, such as
<tt><b>n021003l.pfb</b></tt>.  <b><tt>Fontmap</tt></b> can also create
aliases for font names, so that for instance,
<b><tt>/NimbusNo9L-Regu</tt></b> means the same font as
<b><tt>/Times-Roman</tt></b>.

<hr>

<h2><a name="Free_fonts"></a>Ghostscript's free fonts</h2>

<p>
Two sets of free fonts are supplied for Ghostscript:

<ul>
<li>35 commercial-quality Type 1 basic PostScript fonts -- Times,
Helvetica, Courier, Symbol, etc. -- contributed by URW++ Design and
Development Incorporated, of Hamburg, Germany
(<a href="http://www.urwpp.de/">http://www.urwpp.de/</a>).  Fontmap names
them all.

<li>A miscellaneous set including Cyrillic, kana, and fonts derived from
the free Hershey fonts, with improvements (such as adding accented
characters) by Thomas Wolff.  The Hershey-based fonts are quite different
from traditional printer or display fonts; you can read about them in more
detail in the <a href="Hershey.htm">documentation on Hershey fonts</a>.

</ul>

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Font packages</font><hr>
<tr>	<td><b>System</b>
	<td>&nbsp;&nbsp;
	<td><b>File name</b>
	<td>&nbsp;&nbsp;
	<td><b>Contents</b>
	<td>&nbsp;&nbsp;
	<td><b>Types</b>
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>DOS and<br>MS Windows
	<td>&nbsp;
	<td><b><tt>gs###fn1.zip</tt></b>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><b><tt>.pfb</tt></b>
<tr valign=top>	<td>&nbsp;
	<td>&nbsp;
	<td><b><tt>gs###fn2.zip</tt></b>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td>Various, for<br>different fonts
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>Unix
	<td>&nbsp;
	<td><b><tt>ghostscript-fonts-std-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.pfb</tt></b>,<br><b><tt>.pfm</tt></b> <tr valign=top> <td>&nbsp;
	<td>&nbsp;
	<td><b><tt>ghostscript-fonts-other-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.gsf</tt></b>,<br><b><tt>.pfa</tt></b>, <b><tt>.pfm</tt></b>

</table>
</blockquote>

<p>
"#.##" and "###" are the version number with and without punctuation.
Fonts can be found at

<blockquote>
ftp://ftp.cs.wisc.edu/ghost/aladdin/gs###/ (for a particular version)<br>
<a href="ftp://ftp.cs.wisc.edu/ghost/aladdin/fonts/">ftp://ftp.cs.wisc.edu/ghost/aladdin/fonts/</a> (for several versions)
</blockquote>

<hr>

<h2><a name="Other_fonts"></a>Other free fonts</h2>

<h3><a name="Chinese_font"></a>A free Chinese (Hanzi) font</h3>

<p>
A free Chinese font, originally provided by courtesy of Jackson Technology,
Ltd., Taiwan under the GPL and now distributed by the Taiwan NeXT User
Group, is available from:

<blockquote>
<a href="ftp://ftp.ifcss.org/pub/software/fonts/big5/next/">ftp://ftp.ifcss.org/pub/software/fonts/big5/next/</a><br>
<a href="ftp://ftp.cs.wisc.edu/ghost/hanzi/">ftp://ftp.cs.wisc.edu/ghost/hanzi/</a>
</blockquote>

<h3><a name="Japanese"></a>Free Japanese (Kanji) fonts</h3>

<p>
Mr. Tetsurou Tanaka of the Department of Engineering, University of Tokyo,
has created a set of free Kanji fonts available from

<blockquote>
<a href="ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/">ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/</a><br>
</blockquote>

<p>
along with documentation in Japanese and English describing their
conditions of use and how to use them.  An older copy of these fonts, under
somewhat different names, is available at the Ghostscript site:

<blockquote>
<a href="ftp://ftp.cs.wisc.edu/ghost/kanji/">ftp://ftp.cs.wisc.edu/ghost/kanji/</a><br>
</blockquote>

<p>
Mr. Norio Katayama has done some work to make Ghostscript work well with
Kanji fonts.  An easy-to-install Kanji font for Ghostscript, with
installation instructions, is at

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html</a>
</blockquote>

<p>
The same site has patches to make Ghostscript work with Japanese VF fonts,
with documentation in both English and Japanese:

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html</a>
</blockquote>

<p>
Here are some other resources in Japanese relating to VFlib and using
Ghostscript with Japanese fonts:

<blockquote><dl compact>
<dt><a href="http://www.ldl.jaist.ac.jp/~akr/nonresearch/free-software/ghostscript/index.ja.html">http://www.ldl.jaist.ac.jp/~akr/nonresearch/free-software/ghostscript/index.ja.html</a>
<dd>Author &lt;<a href="mailto:akr@jaist.ac.jp">akr@jaist.ac.jp</a>&gt;
<dt><a href="http://www.se.hiroshima-u.ac.jp/~kakugawa/Hacks/Hacks-JIS.html">http://www.se.hiroshima-u.ac.jp/~kakugawa/Hacks/Hacks-JIS.html</a>
<dt><a href="http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/">http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/</a>
<dd>Author &lt;<a href="mailto:matsuda@itohws01.ee.noda.sut.ac.jp">matsuda@itohws01.ee.noda.sut.ac.jp</a>&gt;
</dl></blockquote>

<h3><a name="Unicode_CMaps"></a>Unicode CMaps</h3>

<p>
The Unicode CMaps distributed with Ghostscript are freely downloadable from

<blockquote>
<a href="ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/">ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/</a>
</blockquote>

<h3><a name="Cyrillic"></a>Free Cyrillic fonts</h3>

<p>
N. Glonty and A. Samarin created in 1989 a Cyrillic extension of TeX's
"Computer Modern" fonts, now freely available through the
<a href="New-user.htm#CTAN">Comprehensive TeX Archive Network</a> (CTAN),
for instance at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/cmcyr/">ftp://ctan.tug.org/tex-archive/fonts/cmcyr/</a>
</blockquote>

<p>
Basil K. Malyshev created the "Paradissa Fonts Collection" in 1993.  It
contains 165 fonts, including the Glonty and Samarin font above plus other
Computer Modern, Euler, and LaTeX fonts, all in PostScript Type 1 format
with <tt><b>.AFM</b></tt> and
<tt><b>.PFM</b></tt> files, compatible with ATM.  The
collection can be found through CTAN, for instance at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/postscript/cm/">ftp://ctan.tug.org/tex-archive/fonts/postscript/cm/</a>
</blockquote>

<p>
These fonts are covered by this license:

<blockquote>
Paradissa fonts collection.<br>
Copyright &copy; 1993, Basil K. Malyshev. All Rights Reserved.

<p align=center>
Licensing agreement</p>

<p>
The author of this fonts grants to any individual or non-commercial
organization the right to use and to make an unlimited number of copies of
full collection or selected fonts when this is done WITHOUT CHARGE and has
attached this licence agreement.

<p>
This fonts cannot be sold or distributed with any commercial product
without written authorization from the author.  If you want to charge a
small fee for distribute fonts as is or with any software, you should
contact the author.

<p>
This restriction is not intended to apply to connect time charges, or flat
rate connection/download fees for electronic bulletin board services.

<p>
Basil K. Malyshev &lt;<a
href="mailto:malyshev@mx.ihep.su">malyshev@mx.ihep.su</a>&gt; 22 December
1993, Protvino, Russia.
</blockquote>

<hr>

<h2><a name="Get_fonts"></a>How Ghostscript gets fonts when it runs</h2>

<p>
Fonts occupy about 50KB each, so Ghostscript doesn't load them all
automatically when it runs.  Instead, as part of normal initialization
Ghostscript runs a file <tt><b>gs_fonts.ps</b></tt>, which arranges to load
fonts on demand using information from the font map.  To preload all of the
known fonts, invoke the procedure

<blockquote><tt><b>
loadallfonts
</b></tt></blockquote>

<p>
The file <tt><b>prfont.ps</b></tt> contains code to print a sample page of
a font.  Load this program by including it in the <tt><b>gs</b></tt>
command line or by invoking

<blockquote><tt><b>
(prfont.ps) run
</b></tt></blockquote>

<p>
Then to produce a sampler of a particular font XYZ, invoke

<blockquote><tt><b>
/XYZ DoFont
</b></tt></blockquote>

<p>For example,

<blockquote><tt><b>
/Times-Roman DoFont
</b></tt></blockquote>

<hr>

<h2><a name="Platform_fonts"></a>Platform fonts</h2>

<p>
Ghostscript displays text on screen using whatever font technology is
provided by the system on which it runs, by calling the system's API to
display text.  On platforms with X Windows, this is X Windows; on MS
Windows it may be TrueType or ATM; Ghostscript neither knows nor cares.

<p>
The PostScript language specifies that fonts are data structures with
particular contents (for instance, they include a bounding box for the
font, an Encoding vector to specify the character set, etc.), and it is
common for PostScript files to use this fact; also, characters can be used
as clipping regions, and can be arbitrarily algorithmically rotated,
skewed, expanded or condensed, etc. Most of this information is available
in some form from the underlying graphics system, but one crucial piece is
not: the actual scalable outlines of the characters, which Ghostscript
needs in order to implement both clipping with character shapes and
arbitrarily transformed characters.  Consequently

<blockquote>
Ghostscript needs the scalable outlines of any font mentioned in a
document, and loads them from the disk (<tt><b>.pfa</b></tt>,
<tt><b>.pfb</b></tt>, or <tt><b>.gsf</b></tt>
file) in the usual way, even if it uses the platform's font machinery to
display the characters. In other words, Ghostscript must still be able to
find its font files.
</blockquote>

<p>
To make matters worse, platforms use different names for their standard
fonts.  For example, the Times Roman font, for which PostScript files use
the name "<b><tt>Times-Roman</tt></b>", may be known as
"<b><tt>Times-Roman</tt></b>", "<b><tt>Times&nbsp;Roman</tt></b>",
"<b><tt>Tms&nbsp;Rmn</tt></b>",
"<b><tt>Times&nbsp;New&nbsp;Roman</tt></b>", or

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -