xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r850426 - in /websites/staging/xmlgraphics/trunk/content: ./ fop/trunk/fonts.html
Date Tue, 12 Feb 2013 23:53:31 GMT
Author: buildbot
Date: Tue Feb 12 23:53:31 2013
New Revision: 850426

Log:
Staging update by buildbot for xmlgraphics

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

Propchange: websites/staging/xmlgraphics/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Feb 12 23:53:31 2013
@@ -1 +1 @@
-1445389
+1445428

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/fonts.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/fonts.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/fonts.html Tue Feb 12 23:53:31 2013
@@ -350,7 +350,7 @@ $(document).ready(function () {
         <div id="items">
         </div>
       	<!-- <div id="breadcrumb"><a href="/">Home</a>&nbsp;&raquo&nbsp;<a
href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/trunk/">Trunk</a></div>
-->
-      	<div class="section-content"><h1 id="apachewzxhzdk10-fop-fonts">Apache&trade;
FOP: Fonts</h1>
+      	<div class="section-content"><h1 id="apachewzxhzdk6-fop-fonts">Apache&trade;
FOP: Fonts</h1>
 <p><authors><person email="" name="Jeremias Märki"></person><person
email="" name="Tore Engvig"></person><person email="" name="Adrian Cumiskey"></person><person
email="" name="Max Berger"></person></authors></p>
 <h2 id="intro">Summary</h2>
 <p>The following table summarizes the font capabilities of the various Apache&trade;
FOP renderers:</p>
@@ -472,17 +472,9 @@ $(document).ready(function () {
 <p>The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the Java AWT
subsystem for font metric information. Through operating system registration, the AWT subsystem
knows what fonts are available on the system, and the font metrics for each one.</p>
 <p>When working with one of these output formats and you're missing a font, just install
it in your operating system and they should be available for these renderers. Please note
that this is not true for other output formats such as PDF or PostScript.</p>
 <h2 id="custom">Custom Fonts</h2>
-<p>Support for custom fonts is highly output format dependent (see above table). This
section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and Java2D-based
renderers. Other renderers (like AFP) support other font formats. Details in this case can
be found on the page about <a href="output.html">output formats</a>.</p>
-<p>In earlier FOP versions, it was always necessary to create an XML font metrics file
if you wanted to add a custom font. This unconvenient step has been removed and in addition
to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts installed in your
operating system or can scan user-specified directories for fonts. Font registration via XML
font metrics file is still supported and may still be necessary for some very special cases
as fallback variant while we stabilize font auto-detection.</p>
-<p>Basic information about fonts can be found at:</p>
-<ul>
-<li>
-<p><a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font
types</a></p>
-</li>
-<li>
-<p><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe
Font Technote</a></p>
-</li>
-</ul>
+<p>Support for custom fonts is highly output format dependent (see above table). This
section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and Java2D-based
renderers. Other renderers (like AFP) support other font formats. Details in this case can
be found on the page about <a href="output.html">output formats</a>. FOP does
not support yet OpenType fonts yet, although that is in the roadmap for the next release.
</p>
+<p>In earlier FOP versions, it was always necessary to create an XML font metrics file
if you wanted to add a custom font. This unconvenient step has been removed and in addition
to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts installed in your
operating system or can scan user-specified directories for fonts. Font registration via XML
font metrics has been deprecated and is not recommended although it is still supported by
the current code.</p>
+<p>More information about fonts can be found at <a href="http://www.adobe.com/devnet/font.html">Adobe
Font Technical Notes</a>.</p>
 <h2 id="bulk">Bulk Font Configuration</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>
@@ -510,9 +502,9 @@ $(document).ready(function () {
        <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="na">embed-url=</span><span class="s">&quot;/System/Library/fonts/Arial.ttf&quot;</span>
+                 <span class="na">embedding-mode=</span><span class="s">&quot;subset&quot;</span><span
class="nt">&gt;</span>
+               <span class="nt">&lt;font-triplet</span> <span class="na">name=</span><span
class="s">&quot;Arial&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>
@@ -522,21 +514,15 @@ $(document).ready(function () {
 
 <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>
+<p>The "embed-url" attribute is used to specify the font file. 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>
 </li>
 <li>
-<p>The "metrics-url" attribute is generally not necessary except if you run into problems
with certain fonts.</p>
-</li>
-<li>
-<p>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</p>
+<p>The "embedding-mode" attribute is optional and can take two values: subset (the
default) and full. If not specified the font is subset embedded unless is explicitly referenced
(see below).</p>
 </li>
 <li>
 <p>The font "kerning" attribute is optional. Default is "true".</p>
 </li>
 <li>
-<p>If embedding is off (i.e. embed-url is not set), the output will position the text
correctly (from the metrics file), but it will not be displayed or printed correctly unless
the viewer has the applicable font available to their local system.</p>
-</li>
-<li>
 <p>When setting the "embed-url" attribute for Type 1 fonts, be sure to specify the
PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font
metrics file.</p>
 </li>
 <li>
@@ -568,18 +554,12 @@ $(document).ready(function () {
 <li>
 <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>
+<li>
+<p>If a fop.xconf is not used, or the "embed-url" attribute is missing, the fonts are
referenced (and the default Base-14 is used in this case).</p>
+</li>
 </ul>
 <h3 id="truetype-collections-metrics">TrueType Collections</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:</p>
-<div class="codehilite"><pre><span class="n">java</span> <span
class="o">-</span><span class="n">cp</span> <span class="n">build</span><span
class="o">\</span><span class="n">fop</span><span class="o">.</span><span
class="n">jar</span><span class="p">;</span><span class="n">lib</span><span
class="o">\</span><span class="n">avalon</span><span class="o">-</span><span
class="n">framework</span><span class="o">.</span><span class="n">jar</span><span
class="p">;</span><span class="n">lib</span><span class="o">\</span><span
class="n">commons</span><span class="o">-</span><span class="n">logging</span><span
class="o">.</span><span class="n">jar</span><span class="p">;</span><span
class="n">lib</span><span class="o">\</span><span class="n">commons</span><span
class="o">-</span><span class="n">io</span><span class="o">.</span><span
class="n">jar</span>
-      <span class="n">org</span><span class="o">.</span><span
class="n">apache</span><span class="o">.</span><span class="n">fop</span><span
class="o">.</span><span class="n">fonts</span><span class="o">.</span><span
class="n">apps</span><span class="o">.</span><span class="n">TTFReader</span>
<span class="o">-</span><span class="n">ttcname</span> <span class="s">&quot;MS
Mincho&quot;</span>
-      <span class="n">msmincho</span><span class="o">.</span><span
class="n">ttc</span> <span class="n">msminch</span><span class="o">.</span><span
class="n">xml</span>
-</pre></div>
-
-
-<p>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:</p>
+<p>TrueType collections (.ttc files) contain more than one font. The individual sub-fonts
of a TrueType Collection can be selected using the "sub-font" attribute on the "font" element.
Example:</p>
 <div class="codehilite"><pre><span class="nt">&lt;font</span>
<span class="na">embed-url=</span><span class="s">&quot;gulim.ttc&quot;</span>
<span class="na">sub-font=</span><span class="s">&quot;GulimChe&quot;</span><span
class="nt">&gt;</span>
   <span class="nt">&lt;font-triplet</span> <span class="na">name=</span><span
class="s">&quot;GulimChe&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>
@@ -600,79 +580,12 @@ $(document).ready(function () {
 <h4 id="font-cache">The font cache</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="type1-metrics">Type 1 Font Metrics</h3>
-<p>Note that metrics files are optional and no longer required</p>
-<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:</p>
-<div class="codehilite"><pre><span class="n">java</span> <span
class="o">-</span><span class="n">cp</span> <span class="n">build</span><span
class="o">\</span><span class="n">fop</span><span class="o">.</span><span
class="n">jar</span><span class="p">;</span><span class="n">lib</span><span
class="o">\</span><span class="n">avalon</span><span class="o">-</span><span
class="n">framework</span><span class="o">.</span><span class="n">jar</span><span
class="p">;</span><span class="n">lib</span><span class="o">\</span><span
class="n">commons</span><span class="o">-</span><span class="n">logging</span><span
class="o">.</span><span class="n">jar</span><span class="p">;</span><span
class="n">lib</span><span class="o">\</span><span class="n">commons</span><span
class="o">-</span><span class="n">io</span><span class="o">.</span><span
class="n">jar</span>
-      <span class="n">org</span><span class="o">.</span><span
class="n">apache</span><span class="o">.</span><span class="n">fop</span><span
class="o">.</span><span class="n">fonts</span><span class="o">.</span><span
class="n">apps</span><span class="o">.</span><span class="n">PFMReader</span>
<span class="p">[</span><span class="n">options</span><span class="p">]</span>
<span class="n">pfm</span><span class="o">-</span><span class="n">file</span>
<span class="n">xml</span><span class="o">-</span><span class="n">file</span>
-</pre></div>
-
-
-<p>Unix:</p>
-<div class="codehilite"><pre><span class="n">java</span> <span
class="o">-</span><span class="n">cp</span> <span class="n">build</span><span
class="sr">/fop.jar:lib/</span><span class="n">avalon</span><span
class="o">-</span><span class="n">framework</span><span class="o">.</span><span
class="n">jar:lib</span><span class="sr">/commons-logging.jar:lib/commo</span><span
class="n">ns</span><span class="o">-</span><span class="n">io</span><span
class="o">.</span><span class="n">jar</span>
-      <span class="n">org</span><span class="o">.</span><span
class="n">apache</span><span class="o">.</span><span class="n">fop</span><span
class="o">.</span><span class="n">fonts</span><span class="o">.</span><span
class="n">apps</span><span class="o">.</span><span class="n">PFMReader</span>
<span class="p">[</span><span class="n">options</span><span class="p">]</span>
<span class="n">pfm</span><span class="o">-</span><span class="n">file</span>
<span class="n">xml</span><span class="o">-</span><span class="n">file</span>
-</pre></div>
-
-
-<p>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.</li>
-</ul>
-<p><note>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.</note></p>
-<p><note>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.</note></p>
-<h3 id="truetype-metrics">TrueType Font Metrics</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:</p>
-<div class="codehilite"><pre><span class="n">java</span> <span
class="o">-</span><span class="n">cp</span> <span class="n">build</span><span
class="o">\</span><span class="n">fop</span><span class="o">.</span><span
class="n">jar</span><span class="p">;</span><span class="n">lib</span><span
class="o">\</span><span class="n">avalon</span><span class="o">-</span><span
class="n">framework</span><span class="o">-</span><span class="mf">4.2.0</span><span
class="o">.</span><span class="n">jar</span><span class="p">;</span><span
class="n">lib</span><span class="o">\</span><span class="n">commons</span><span
class="o">-</span><span class="n">logging</span><span class="o">-</span><span
class="mf">1.0.4</span><span class="o">.</span><span class="n">jar</span><span
class="p">;</span><span class="n">lib</span><span class="o">\</span><span
class="n">commons</span><span class="o">-</span><span class="n">io</span><span
class="o">-</span><span class="mf">1.3.1</span><span class="o">.</span><
 span class="n">jar</span><span class="p">;</span><span class="n">lib</span><span
class="o">\</span><span class="n">commons</span><span class="o">-</span><span
class="n">logging</span><span class="o">-</span><span class="mf">1.0.4</span><span
class="o">.</span><span class="n">jar</span><span class="p">;</span><span
class="n">lib</span><span class="o">\</span><span class="n">xmlgraphics</span><span
class="o">-</span><span class="n">commons</span><span class="o">-</span><span
class="mf">1.5</span><span class="o">.</span><span class="n">jar</span>
-      <span class="n">org</span><span class="o">.</span><span
class="n">apache</span><span class="o">.</span><span class="n">fop</span><span
class="o">.</span><span class="n">fonts</span><span class="o">.</span><span
class="n">apps</span><span class="o">.</span><span class="n">TTFReader</span>
<span class="p">[</span><span class="n">options</span><span class="p">]</span>
-      <span class="n">C:</span><span class="o">\</span><span class="n">myfonts</span><span
class="o">\</span><span class="n">cmr10</span><span class="o">.</span><span
class="n">ttf</span> <span class="n">ttfcm</span><span class="o">.</span><span
class="n">xml</span>
-</pre></div>
-
-
-<p>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>
-</tbody>
-</table>
-<p><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></p>
-<h3 id="embedding">Embedding</h3>
+<h3 id="referencing_fonts">Referencing Fonts</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>
 <li>
-<p>When using the old-style "font" element to configure a single font, font referencing
is controlled by the embed-url attribute. If you don't specify the embed-url attribute the
font will not be embedded, but will only be referenced.</p>
+<p>When explicitly configuring a font, font referencing is controlled by the embed-url
attribute. If you don't specify the embed-url attribute the font will not be embedded, but
will only be referenced.</p>
 </li>
 <li>
 <p>For automatically configured fonts there's a different mechanism to specify which
fonts should be referenced rather than embedded. This is done in the "referenced-fonts" element
in the configuration. Here's an example:</p>
@@ -691,16 +604,11 @@ $(document).ready(function () {
 </ol>
 <p>At the moment, you can only match fonts against their font-family. It is possible
to use regular expressions as is shown in the second example above ("DejaVu.*"). The syntax
for the regular expressions used here are the one used by the <a href="http://java.sun.com/j2se/1.4/docs/api/java/util/regex/package-summary.html">package</a>.
So, in the above snippet "Helvetica" and all variants of the "DejaVu" font family are referenced.
If you want to reference all fonts, just specify <code>font-family=".*"</code>.</p>
 <p>The <code>referenced-fonts</code> element can be placed either inside
the general <code>fonts</code> element (right under the root) or in the <code>fonts</code>
element under the renderer configuration. In the first case, matches apply to all renderers.
In the second case, matches only apply to the renderer where the element was specified. Both
cases can be used at the same time.</p>
-<p>Various notes related to embedded fonts:</p>
+<h3 id="embedding_fonts">Embedding Fonts</h3>
+<p>Some notes related to embedded fonts:</p>
 <ul>
 <li>
-<p>The PostScript renderer does not yet support TrueType fonts, but can embed Type
1 fonts.</p>
-</li>
-<li>
-<p>The font is simply embedded into the PDF file, it is not converted.</p>
-</li>
-<li>
-<p>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name
will not match the fontname of an installed font. This is helpful with older versions of Acrobat
Reader that preferred installed fonts over embedded fonts.</p>
+<p>When FOP embeds a font in PDF, it adds a prefix to the fontname to ensure that the
name will not match the fontname of an installed font. This is helpful with older versions
of Acrobat Reader that preferred installed fonts over embedded fonts.</p>
 </li>
 <li>
 <p>When embedding PostScript fonts, the entire font is always embedded.</p>
@@ -709,7 +617,7 @@ $(document).ready(function () {
 <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">Substitution</h3>
+<h3 id="font_substitution">Font Substitution</h3>
 <p>When a <code>&lt;substitutions/&gt;</code> 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>



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


Mime
View raw message