xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r838227 - in /websites/staging/xmlgraphics/trunk/content: ./ fop/1.1/fonts.html
Date Tue, 13 Nov 2012 12:11:41 GMT
Author: buildbot
Date: Tue Nov 13 12:11:41 2012
New Revision: 838227

Log:
Staging update by buildbot for xmlgraphics

Modified:
    websites/staging/xmlgraphics/trunk/content/   (props changed)
    websites/staging/xmlgraphics/trunk/content/fop/1.1/fonts.html

Propchange: websites/staging/xmlgraphics/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Nov 13 12:11:41 2012
@@ -1 +1 @@
-1408612
+1408690

Modified: websites/staging/xmlgraphics/trunk/content/fop/1.1/fonts.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.1/fonts.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.1/fonts.html Tue Nov 13 12:11:41 2012
@@ -467,125 +467,43 @@ $(document).ready(function () {
 <p><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe
Font Technote</a> </p>
 </li>
 </ul>
-<h2 id="basic-font-configuration-wzxhzdk28wzxhzdk29">Basic font configuration <a
id="basics"></a></h2>
-<p>If you want FOP to use custom fonts, you need to tell it where to find them. This
is done in the configuration file and once per renderer (because each output format is a little
different). In the basic form, you can either tell FOP to find your operating system fonts
or you can specify directories that it will search for support fonts. These fonts will then
automatically be registered.</p>
-<p><renderers>
-   <renderer mime="application/pdf">
-      <fonts>
-         <!-- register all the fonts found in a directory -->
-         <directory>C:\MyFonts1</directory></p>
-<div class="codehilite"><pre>     <span class="c">&lt;!-- register
all the fonts found in a directory and all of its sub directories (use with care) --&gt;</span>
-     <span class="nt">&lt;directory</span> <span class="na">recursive=</span><span
class="s">&quot;true&quot;</span><span class="nt">&gt;</span>C:\MyFonts2<span
class="nt">&lt;/directory&gt;</span>
-
-     <span class="c">&lt;!-- automatically detect operating system installed fonts
--&gt;</span>
-     <span class="nt">&lt;auto-detect/&gt;</span>  
-  <span class="nt">&lt;/fonts&gt;</span>
+<h2 id="bulk-font-configuration-wzxhzdk28wzxhzdk29">Bulk Font Configuration <a id="bulk"></a></h2>
+<p>If you want FOP to use custom fonts, you need to tell it where to find them. This
is done in the configuration file and once per renderer (because each output format is a little
different). For convenience, FOP allows bulk registering of fonts; you can either tell FOP
to find your operating system fonts or you can specify directories that it will search for
support fonts. These fonts will then automatically be registered.</p>
+<div class="codehilite"><pre><span class="nt">&lt;renderers&gt;</span>
+  <span class="nt">&lt;renderer</span> <span class="na">mime=</span><span
class="s">&quot;application/pdf&quot;</span><span class="nt">&gt;</span>
+     <span class="nt">&lt;fonts&gt;</span>
+        <span class="c">&lt;!-- register all the fonts found in a directory --&gt;</span>
+        <span class="nt">&lt;directory&gt;</span>C:\MyFonts1<span
class="nt">&lt;/directory&gt;</span>
+
+        <span class="c">&lt;!-- register all the fonts found in a directory and
all of its sub directories (use with care) --&gt;</span>
+        <span class="nt">&lt;directory</span> <span class="na">recursive=</span><span
class="s">&quot;true&quot;</span><span class="nt">&gt;</span>C:\MyFonts2<span
class="nt">&lt;/directory&gt;</span>
+
+        <span class="c">&lt;!-- automatically detect operating system installed
fonts --&gt;</span>
+        <span class="nt">&lt;auto-detect/&gt;</span>  
+     <span class="nt">&lt;/fonts&gt;</span>
+  <span class="nt">&lt;/renderer&gt;</span>
+<span class="nt">&lt;/renderers&gt;</span>
 </pre></div>
 
 
-<p></renderer>
-</renderers>Review the documentation for <a href="configuration.html">FOP Configuration</a>
for instructions on making the FOP configuration available to FOP when it runs. Otherwise,
FOP has no way of finding your custom font information. It is currently not possible to easily
configure fonts from Java code.</p>
-<h1 id="advanced-font-configuration-wzxhzdk38wzxhzdk39">Advanced font configuration
<a id="advanced"></a></h1>
-<p>The instructions found above should be sufficient for most users. Below are some
additional instructions in case the basic font configuration doesn't lead to the desired results.</p>
-<h3 id="type-1-font-metrics-wzxhzdk40wzxhzdk41">Type 1 Font Metrics <a id="type1-metrics"></a></h3>
-<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type
1 font, and generates an appropriate font metrics file for it. To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
-<p>Windows:
-java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
-          org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file
-Unix:
-java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
-          org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file
-PFMReader [options]:</p>
-<ul>
-<li><strong>-fn <fontname></strong> By default, FOP uses the fontname
from the .pfm file when embedding the font. Use the "-fn" option to override this name with
one you have chosen. This may be useful in some cases to ensure that applications using the
output document (Acrobat Reader for example) use the embedded font instead of a local font
with the same name.
-The classpath in the above example has been simplified for readability. You will have to
adjust the classpath to the names of the actual JAR files in the lib directory. xml-apis.jar,
xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.The
tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and
calculations which are only an approximation to the real values. FontBBox and Italic Angle
can be found in the human-readable part of the PFB file or in the AFM file. The PFMReader
tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to
adjust the values in the XML file manually. The constructed values however appear to have
no visible influence.</li>
-</ul>
-<h2 id="truetype-font-metrics-wzxhzdk42wzxhzdk43">TrueType Font Metrics <a id="truetype-metrics"></a></h2>
-<p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font
metrics file for it. Use it in a similar manner to PFMReader. For example, to create such
a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
-java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
-          org.apache.fop.fonts.apps.TTFReader [options]
-          C:\myfonts\cmr10.ttf ttfcm.xml
-TTFReader [options]:</p>
-<ul>
-<li>
-<p><strong>-d <DEBUG | INFO ></strong> Sets the debug level (default
is INFO).</p>
-</li>
-<li>
-<p><strong>-fn <fontname></strong> Same as for PFMReader.</p>
-</li>
-<li>
-<p><strong>-ttcname <fontname></strong> If you're reading data from
a TrueType Collection (.ttc file) you must specify which font from the collection you will
read metrics from. If you read from a .ttc file without this option, the fontnames will be
listed for you.</p>
-</li>
-<li>
-<p><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
Without this option, a CID-keyed font metrics file is created. The table below summarizes
the differences between these two encoding options as currently used within FOP. Please note
that this information only applies to TrueType fonts and TrueType collections:</p>
-</li>
-</ul>
-<table>
-<thead>
-<tr>
-<th>Issue</th>
-<th>WinAnsi</th>
-<th>CID-keyed</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>Usable Character Set</td>
-<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
-<td>Limited only by the characters in the font itself.</td>
-</tr>
-<tr>
-<td>Embedding the Font</td>
-<td>Optional.</td>
-<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
-</tr>
-<tr>
-<td><warning>You may experience failures with certain TrueType fonts, especially
if they don't contain the so-called Unicode "cmap" table. TTFReader can currently not deal
with font like this.</warning></td>
-<td></td>
-<td></td>
-</tr>
-<tr>
-<td>## TrueType Collections <a id="truetype-collections-metrics"></a></td>
-<td></td>
-<td></td>
-</tr>
-</tbody>
-</table>
-<p>TrueType collections (.ttc files) contain more than one font. To create metrics
files for these fonts, you must specify which font in the collection should be generated,
by using the "-ttcname" option with the TTFReader.</p>
-<p>To get a list of the fonts in a collection, just start the TTFReader as if it were
a normal TrueType file (without the -ttcname option). It will display all of the font names
and exit with an Exception.</p>
-<p>Here is an example of generating a metrics file for a .ttc file:
-java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
-          org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
-          msmincho.ttc msminch.xml
-Alternatively, the individual sub-fonts of a TrueType Collections can be selected using the
"sub-font" attribute on the "font" element. That means that generating an XML font metrics
file for TrueType collections is not necessary anymore. Example:
-<font embed-url="gulim.ttc" sub-font="GulimChe">
-  <font-triplet name="GulimChe" style="normal" weight="normal"/>
-</font></p>
-<h2 id="register-fonts-with-fop-wzxhzdk47wzxhzdk48">Register Fonts with FOP <a id="register"></a></h2>
-<p>You must tell FOP how to find and use the font metrics files by registering them
in the <a href="configuration.html">FOP Configuration</a> . Add entries for your
custom fonts, regardless of font type, to the configuration file in a manner similar to the
following:</p>
-<p><renderers>
-   <renderer mime="application/pdf">
-      <fonts>
-         <!-- register a particular font -->
-         <font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
-           embed-url="file:///C:/myfonts/FTL_____.pfb"
-           encoding-mode="single-byte">
-            <font-triplet name="FrutigerLight" style="normal" weight="normal"/>
-         </font></p>
-<div class="codehilite"><pre>     <span class="c">&lt;!-- register
all the fonts found in a directory --&gt;</span>
-     <span class="nt">&lt;directory&gt;</span>C:\MyFonts1<span class="nt">&lt;/directory&gt;</span>
-
-     <span class="c">&lt;!-- register all the fonts found in a directory and all
of its sub directories (use with care) --&gt;</span>
-     <span class="nt">&lt;directory</span> <span class="na">recursive=</span><span
class="s">&quot;true&quot;</span><span class="nt">&gt;</span>C:\MyFonts2<span
class="nt">&lt;/directory&gt;</span>
-
-     <span class="c">&lt;!-- automatically detect operating system installed fonts
--&gt;</span>
-     <span class="nt">&lt;auto-detect/&gt;</span>  
-  <span class="nt">&lt;/fonts&gt;</span>
+<p>Review the documentation for <a href="configuration.html">FOP Configuration</a>
for instructions on making the FOP configuration available to FOP when it runs. Otherwise,
FOP has no way of finding your custom font information. It is currently not possible to easily
configure fonts from Java code.</p>
+<h2 id="register-fonts-with-fop-wzxhzdk30wzxhzdk31">Register Fonts with FOP <a id="register"></a></h2>
+<p>You must tell FOP how to find and use the font files by registering them in the
<a href="configuration.html">FOP Configuration</a> . Add entries for your custom
fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
+<div class="codehilite"><pre><span class="nt">&lt;renderers&gt;</span>
+   <span class="nt">&lt;renderer</span> <span class="na">mime=</span><span
class="s">&quot;application/pdf&quot;</span><span class="nt">&gt;</span>
+       <span class="nt">&lt;fonts&gt;</span>
+           <span class="c">&lt;!-- register a particular font --&gt;</span>
+           <span class="nt">&lt;font</span> <span class="na">kerning=</span><span
class="s">&quot;yes&quot;</span>
+                 <span class="na">embed-url=</span><span class="s">&quot;file:///C:/myfonts/FTL_____.pfb&quot;</span>
+                 <span class="na">encoding-mode=</span><span class="s">&quot;single-byte&quot;</span><span
class="nt">&gt;</span>
+               <span class="nt">&lt;font-triplet</span> <span class="na">name=</span><span
class="s">&quot;FrutigerLight&quot;</span> <span class="na">style=</span><span
class="s">&quot;normal&quot;</span> <span class="na">weight=</span><span
class="s">&quot;normal&quot;</span><span class="nt">/&gt;</span>
+           <span class="nt">&lt;/font&gt;</span>
+       <span class="nt">&lt;/fonts&gt;</span>
+   <span class="nt">&lt;/renderer&gt;</span>
+<span class="nt">&lt;/renderers&gt;</span>
 </pre></div>
 
 
-<p></renderer>
-</renderers></p>
 <ul>
 <li>
 <p>URLs are used to access the font metric and font files. Relative URLs are resolved
relative to the font-base property (or base) if available. See <a href="configuration.html">FOP:
Configuration</a> for more information.</p>
@@ -635,7 +553,18 @@ Alternatively, the individual sub-fonts 
 <p>If relative URLs are specified, they are evaluated relative to the value of the
"font-base" setting. If there is no "font-base" setting, the fonts are evaluated relative
to the base directory.</p>
 </li>
 </ul>
-<h3 id="auto-detect-and-auto-embed-feature-wzxhzdk58wzxhzdk59">Auto-Detect and auto-embed
feature <a id="autodetect"></a></h3>
+<h3 id="truetype-collections-wzxhzdk32wzxhzdk33">TrueType Collections <a id="truetype-collections-metrics"></a></h3>
+<p>TrueType collections (.ttc files) contain more than one font. To create metrics
files for these fonts, you must specify which font in the collection should be generated,
by using the "-ttcname" option with the TTFReader.</p>
+<p>To get a list of the fonts in a collection, just start the TTFReader as if it were
a normal TrueType file (without the -ttcname option). It will display all of the font names
and exit with an Exception.</p>
+<p>Here is an example of generating a metrics file for a .ttc file:
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
+          org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
+          msmincho.ttc msminch.xml
+Alternatively, the individual sub-fonts of a TrueType Collections can be selected using the
"sub-font" attribute on the "font" element. That means that generating an XML font metrics
file for TrueType collections is not necessary anymore. Example:
+<font embed-url="gulim.ttc" sub-font="GulimChe">
+  <font-triplet name="GulimChe" style="normal" weight="normal"/>
+</font></p>
+<h3 id="auto-detect-and-auto-embed-feature-wzxhzdk37wzxhzdk38">Auto-Detect and auto-embed
feature <a id="autodetect"></a></h3>
 <p>When the "auto-detect" flag is set in the configuration, FOP will automatically
search for fonts in the default paths for your operating system.</p>
 <p>FOP will also auto-detect fonts which are available in the classpath, if they are
described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file
contains font/myfont.ttf:
 Manifest-Version: 1.0</p>
@@ -645,10 +574,71 @@ Manifest-Version: 1.0</p>
 
 
 <p>This feature allows you to create JAR files containing fonts. The JAR files can
be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
-<h4 id="the-font-cache-wzxhzdk60wzxhzdk61">The font cache ## <a id="font-cache"></a></h4>
+<h4 id="the-font-cache-wzxhzdk39wzxhzdk40">The font cache ## <a id="font-cache"></a></h4>
 <p>Apache FOP maintains a cache file that is used to speed up auto-detection. This
file is usually found in the ".fop" directory under the user's home directory. It's called
"fop-fonts.cache". When the user's home directory is not writable, the font cache file is
put in the directory for temporary files.</p>
 <p>If there was a problem loading a particular font, it is flagged in the cache file
so it is not loaded anymore. So, if a font is actually around but is still not found by Apache
FOP, it's worth a try to delete the font cache file which forces Apache FOP to reparse all
fonts.</p>
-<h3 id="embedding-wzxhzdk62wzxhzdk63">Embedding <a id="embedding"></a></h3>
+<h3 id="type-1-font-metrics-wzxhzdk41wzxhzdk42">Type 1 Font Metrics <a id="type1-metrics"></a></h3>
+<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type
1 font, and generates an appropriate font metrics file for it. To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
+<p>Note that metrics files are optional and no longer required</p>
+<p>Windows:
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
+          org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file
+Unix:
+java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
+          org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file
+PFMReader [options]:</p>
+<ul>
+<li><strong>-fn <fontname></strong> By default, FOP uses the fontname
from the .pfm file when embedding the font. Use the "-fn" option to override this name with
one you have chosen. This may be useful in some cases to ensure that applications using the
output document (Acrobat Reader for example) use the embedded font instead of a local font
with the same name.
+The classpath in the above example has been simplified for readability. You will have to
adjust the classpath to the names of the actual JAR files in the lib directory. xml-apis.jar,
xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.The
tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and
calculations which are only an approximation to the real values. FontBBox and Italic Angle
can be found in the human-readable part of the PFB file or in the AFM file. The PFMReader
tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to
adjust the values in the XML file manually. The constructed values however appear to have
no visible influence.</li>
+</ul>
+<h3 id="truetype-font-metrics-wzxhzdk43wzxhzdk44">TrueType Font Metrics <a id="truetype-metrics"></a></h3>
+<p>Note that metrics files are optional and no longer required</p>
+<p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font
metrics file for it. Use it in a similar manner to PFMReader. For example, to create such
a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
+java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
+          org.apache.fop.fonts.apps.TTFReader [options]
+          C:\myfonts\cmr10.ttf ttfcm.xml
+TTFReader [options]:</p>
+<ul>
+<li>
+<p><strong>-d <DEBUG | INFO ></strong> Sets the debug level (default
is INFO).</p>
+</li>
+<li>
+<p><strong>-fn <fontname></strong> Same as for PFMReader.</p>
+</li>
+<li>
+<p><strong>-ttcname <fontname></strong> If you're reading data from
a TrueType Collection (.ttc file) you must specify which font from the collection you will
read metrics from. If you read from a .ttc file without this option, the fontnames will be
listed for you.</p>
+</li>
+<li>
+<p><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
Without this option, a CID-keyed font metrics file is created. The table below summarizes
the differences between these two encoding options as currently used within FOP. Please note
that this information only applies to TrueType fonts and TrueType collections:</p>
+</li>
+</ul>
+<table>
+<thead>
+<tr>
+<th>Issue</th>
+<th>WinAnsi</th>
+<th>CID-keyed</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Usable Character Set</td>
+<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
+<td>Limited only by the characters in the font itself.</td>
+</tr>
+<tr>
+<td>Embedding the Font</td>
+<td>Optional.</td>
+<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
+</tr>
+<tr>
+<td><warning>You may experience failures with certain TrueType fonts, especially
if they don't contain the so-called Unicode "cmap" table. TTFReader can currently not deal
with font like this.</warning></td>
+<td></td>
+<td></td>
+</tr>
+</tbody>
+</table>
+<h3 id="embedding-wzxhzdk45wzxhzdk46">Embedding <a id="embedding"></a></h3>
 <p>By default, all fonts are embedded if an output format supports font embedding.
In some cases, however, it is preferred that some fonts are only referenced. When working
with referenced fonts it is important to be in control of the target environment where the
produced document is consumed, i.e. the necessary fonts have to be installed there.</p>
 <p>There are two different ways how you can specify that a font should be referenced:</p>
 <ol>
@@ -687,7 +677,7 @@ At the moment, you can only match fonts 
 <p>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
original font, containing only the glyphs used, is embedded in the output document. That's
the default, but if you specify encoding-mode="single-byte" (see above), the complete font
is embedded.</p>
 </li>
 </ul>
-<h3 id="substitution-wzxhzdk72wzxhzdk73">Substitution <a id="substitution"></a></h3>
+<h3 id="substitution-wzxhzdk55wzxhzdk56">Substitution <a id="substitution"></a></h3>
 <p>When a <substitutions/> section is defined in the configuration, FOP will
re-map any font-family references found in your FO input to a given substitution font.</p>
 <ul>
 <li>
@@ -712,7 +702,7 @@ At the moment, you can only match fonts 
       </substitutions>
    </fonts>
 </fop></p>
-<h1 id="font-selection-strategies-wzxhzdk89wzxhzdk90">Font Selection Strategies <a
id="selection"></a></h1>
+<h1 id="font-selection-strategies-wzxhzdk72wzxhzdk73">Font Selection Strategies <a
id="selection"></a></h1>
 <p>There are two font selection strategies: character-by-character or auto. The default
is auto.</p>
 <p>Auto selected the first font from the list which is able to display the most characters
in a given word. This means (assume font A has characters for abclmn, font B for lnmxyz, fontlist
is A,B):</p>
 <ul>
@@ -730,7 +720,7 @@ At the moment, you can only match fonts 
 </li>
 </ul>
 <p>Character-by-Character is NOT yet supported!</p>
-<h2 id="font-list-command-line-tool-wzxhzdk91wzxhzdk92">Font List Command-Line Tool
<a id="font-list"></a></h2>
+<h2 id="font-list-command-line-tool-wzxhzdk74wzxhzdk75">Font List Command-Line Tool
<a id="font-list"></a></h2>
 <p>FOP contains a small command-line tool that lets you generate a list of all configured
fonts. Its class name is: <code>org.apache.fop.tools.fontlist.FontListMain</code>
. Run it with the "-?" parameter to get help for the various options.</p></div>
       </div>
       



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message