xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r813018 [8/24] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/ fop/0.95/ fop/0.95/images/ fop/1.0/ fop/1.0/images/ fop/dev/ fop/dev/design/ fop/dev/fo/ fop/dev/svg/ fop/fo/ fop/trunk/ fop/trunk/images/
Date Sun, 15 Apr 2012 05:39:54 GMT
Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,470 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Fonts</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Fonts</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version><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>
+<h1 id="intro">Summary</h1>
+<p>The following table summarizes the font capabilities of the various Apache� FOP renderers:</p>
+<table>
+<thead>
+<tr>
+<th>Renderer</th>
+<th>Base-14</th>
+<th>AWT/OS</th>
+<th>Custom</th>
+<th>Custom Embedding</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>PDF</td>
+<td>yes</td>
+<td>no</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr>
+<td>PostScript</td>
+<td>yes</td>
+<td>no</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr>
+<td>PCL</td>
+<td>yes (modified)</td>
+<td>yes (painted as bitmaps)</td>
+<td>yes (painted as bitmaps)</td>
+<td>no</td>
+</tr>
+<tr>
+<td>AFP</td>
+<td>no</td>
+<td>no</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr>
+<td>Java2D/AWT/Bitmap</td>
+<td>if available from OS</td>
+<td>yes</td>
+<td>yes</td>
+<td>n/a (display only)</td>
+</tr>
+<tr>
+<td>Print</td>
+<td>if available from OS</td>
+<td>yes</td>
+<td>yes</td>
+<td>controlled by OS printer driver</td>
+</tr>
+<tr>
+<td>RTF</td>
+<td>n/a (font metrics not needed)</td>
+<td>n/a</td>
+<td>n/a</td>
+<td>n/a</td>
+</tr>
+<tr>
+<td>TXT</td>
+<td>yes (used for layout but not for output)</td>
+<td>no</td>
+<td>yes (used for layout but not for output)</td>
+<td>no</td>
+</tr>
+<tr>
+<td>XML</td>
+<td>yes</td>
+<td>no</td>
+<td>yes</td>
+<td>n/a</td>
+</tr>
+</tbody>
+</table>
+<h1 id="base-14-fonts-base-14fonts">Base-14 Fonts # {#Base-14+Fonts}</h1>
+<p>The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be available to every PostScript interpreter and PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.</p>
+<p>The following font family names are hard-coded into FOP for the Base-14 font set:</p>
+<table>
+<thead>
+<tr>
+<th>Base-14 font</th>
+<th>font families</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Helvetica</td>
+<td>Helvetica, sans-serif, SansSerif</td>
+</tr>
+<tr>
+<td>Times</td>
+<td>Times, Times Roman, Times-Roman, serif, any</td>
+</tr>
+<tr>
+<td>Courier</td>
+<td>Courier, monospace, Monospaced</td>
+</tr>
+<tr>
+<td>Symbol</td>
+<td>Symbol</td>
+</tr>
+<tr>
+<td>ZapfDingbats</td>
+<td>ZapfDingbats</td>
+</tr>
+</tbody>
+</table>
+<p>Please note that recent versions of Adobe Acrobat Reader replace "Helvetica" with "Arial" and "Times" with "Times New Roman" internally. GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with "Nimbus Roman No9 L". Other document viewers may do similar font substitutions. If you need to make sure that there are no such substitutions, you need to specify an explicit font and embed it in the target document.</p>
+<h1 id="missing-fonts">Missing Fonts</h1>
+<p>When FOP does not have a specific font at its disposal (because it's not installed in the operating system or set up in FOP's configuration), the font is replaced with "any". "any" is internally mapped to the Base-14 font "Times" (see above).</p>
+<h1 id="missing-glyphs">Missing Glyphs</h1>
+<p>Every font contains a particular set of <a href="http://en.wikipedia.org/wiki/Glyph">glyphs</a> . If no glyph can be found for a given character, FOP will issue a warning and use the glpyh for "#" (if available) instead. Before it does that, it consults a (currently hard-coded) registry of glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons). This registry can supply alternative glyphs in some cases (like using space when a no-break space is requested). But there's no guarantee that the result will be as expected (for example, in the case of hyphens and similar glyphs). A better way is to use a font that has all the necessary glyphs. This glyph substitution is only a last resort.</p>
+<h1 id="awt">Java2D/AWT/Operating System Fonts</h1>
+<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>
+<h1 id="custom">Custom Fonts</h1>
+<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>
+<h1 id="basics">Basic font configuration</h1>
+<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>
+</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">Advanced font configuration</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>
+<h2 id="type1-metrics">Type 1 Font Metrics</h2>
+<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-metrics">TrueType Font Metrics</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 id="truetype-collections-metrics">## TrueType Collections</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">Register Fonts with FOP</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>
+</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>
+</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>
+</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>
+<p>The attribute "encoding-mode" is optional an may have the following values:</p>
+<ul>
+<li>
+<p>auto: default font encoding mode ("cid" for Truetype, "single-byte" for Type 1)</p>
+</li>
+<li>
+<p>single-byte: use single-byte encodings in the target format (if applicable)</p>
+</li>
+<li>
+<p>cid: encode as CID-keyed font (currently only supported for PDF output with TrueType fonts)</p>
+</li>
+</ul>
+</li>
+<li>
+<p>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</p>
+</li>
+<li>
+<p>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.</p>
+</li>
+<li>
+<p>Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.</p>
+</li>
+<li>
+<p>Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.</p>
+</li>
+<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>
+</ul>
+<h2 id="autodetect">Auto-Detect and auto-embed feature</h2>
+<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>
+<div class="codehilite"><pre>      <span class="n">Name:</span> <span class="n">font</span><span class="o">/</span><span class="n">myfont</span><span class="o">.</span><span class="n">ttf</span>
+      <span class="n">Content</span><span class="o">-</span><span class="n">Type:</span> <span class="n">application</span><span class="o">/</span><span class="n">x</span><span class="o">-</span><span class="n">font</span>
+</pre></div>
+
+
+<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>
+<h2 id="embedding">Embedding</h2>
+<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>
+</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>
+</li>
+</ol>
+<p><fop version="1.0">
+   <fonts>
+      <referenced-fonts>
+        <match font-family="Helvetica"/>
+        <match font-family="DejaVu.*"/>
+      </referenced-fonts>
+   </fonts>
+</fop>
+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>
+<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>
+</li>
+<li>
+<p>When embedding PostScript fonts, the entire font is always embedded.</p>
+</li>
+<li>
+<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>
+<h2 id="substitution">Substitution</h2>
+<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>
+<p>If a <substitution/> is declared, it is mandatory that both a <from/> and <to/> child element is declared with a font-family attribute.</p>
+</li>
+<li>
+<p>Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.</p>
+</li>
+</ul>
+<p>For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.</p>
+<p><fop version="1.0">
+   <fonts>
+      <substitutions>
+         <substitution>
+            <from font-family="Arial" font-weight="700..900"/>
+            <to font-family="Arial Black"/>
+         </substitution>
+         <substitution>
+            <from font-family="FrutigerLight"/>
+            <to font-family="Times" font-weight="bold" font-style="italic"/>
+         </substitution>
+      </substitutions>
+   </fonts>
+</fop></p>
+<h1 id="selection">Font Selection Strategies</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>
+<li>
+<p>aaa lll xxx would be displayed in fonts A A B</p>
+</li>
+<li>
+<p>aaaxx would be displayed in font A</p>
+</li>
+<li>
+<p>aaaxxx would be displayed in font A</p>
+</li>
+<li>
+<p>aaaxxxx would be displayed in font B</p>
+</li>
+</ul>
+<p>Character-by-Character is NOT yet supported!</p>
+<h1 id="font-list">Font List Command-Line Tool</h1>
+<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>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,362 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Graphics Formats</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Graphics Formats</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<h1 id="introduction">Introduction</h1>
+<p>Some noteworthy features of the image handling subsystem are:</p>
+<ul>
+<li>
+<p>The image libraries Jimi and JAI are not supported. Instead, Apache™ FOP uses the Image I/O API that was introduced with Java 1.4 for all bitmap codecs.</p>
+</li>
+<li>
+<p>Some bitmap images are not converted to a standardized 24 bit RGB image but are instead handled in their native format.</p>
+</li>
+<li>
+<p>A plug-in mechanism offers a possibility to add support for new formats without changing the FOP's source code.</p>
+</li>
+</ul>
+<p>The actual <a href="http://xmlgraphics.apache.org/commons/image-loader.html">image loading framework</a> does not reside in Apache FOP, but in <a href="http://xmlgraphics.apache.org/commons/">XML Graphics Commons</a> .</p>
+<h1 id="support-overview">Overview of Graphics Support</h1>
+<p>The table below summarizes the <em>theoretical</em> support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats <em>should</em> work. However, many of them have not been tested, and there may be limitations that have not yet been discovered or documented. The packages needed to support some formats are not included in the FOP distribution and must be installed separately. Follow the links in the "Support Through" columns for more details.</p>
+<table>
+<thead>
+<tr>
+<th>Format</th>
+<th>Type</th>
+<th>Support Through</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href="#native">Apache FOP (native)</a></td>
+<td><a href="#batik">Apache Batik</a></td>
+<td><a href="#imageio">Image I/O</a></td>
+</tr>
+<tr>
+<td>---------------------</td>
+<td>--------------</td>
+<td>-----------</td>
+</tr>
+<tr>
+<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
+<td>bitmap</td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
+<td>vector (with embedded bitmaps)</td>
+<td>(X)</td>
+</tr>
+<tr>
+<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
+<td>metafile (both bitmap and vector), most frequently used for vector drawings</td>
+<td>(X)</td>
+</tr>
+<tr>
+<td>GIF (Graphics Interchange Format)</td>
+<td>bitmap</td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
+<td>bitmap</td>
+<td>(X)</td>
+</tr>
+<tr>
+<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
+<td>bitmap</td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
+<td>vector (with embedded bitmaps)</td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
+<td>bitmap</td>
+<td>(X)</td>
+</tr>
+<tr>
+<td><a href="#wmf">WMF</a> (Windows Metafile)</td>
+<td>vector (with embedded bitmaps)</td>
+<td></td>
+</tr>
+</tbody>
+</table>
+<p>Legend:</p>
+<ul>
+<li>
+<p>"(X)" means restricted support. Please see the details below.</p>
+</li>
+<li>
+<p>[1]: Requires the presence of <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> (or an equivalent Image I/O compatible codec) in the classpath. JAI Image I/O Tools also adds support for JPEG 2000, WBMP, RAW and PNM. Other Image I/O codecs may provide support for additional formats.
+ <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> is not the same as the <a href="http://java.sun.com/javase/technologies/desktop/media/jai/">JAI library</a> ! The former simply exposes JAI's codecs using the Image&nbsp;I/O API but does not include all the image manipulation functionality.</p>
+</li>
+</ul>
+<h2 id="format-map">Map of supported image formats by output format</h2>
+<p>Not all image formats are supported for all output formats! For example, while you can use EPS (Encapsulated PostScript) files when you generate PostScript output, this format will not be supported by any other output format. Here's an overview of which image formats are supported by which output format:</p>
+<table>
+<thead>
+<tr>
+<th>Image Format</th>
+<th>PDF</th>
+<th>PostScript</th>
+<th>Java2D, PNG, TIFF, AWT</th>
+<th>PCL</th>
+<th>AFP</th>
+<th>RTF</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
+<td></td>
+<td></td>
+<td></td>
+<td></td>
+<td></td>
+<td>X [1]</td>
+</tr>
+<tr>
+<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
+<td></td>
+<td>X [1]</td>
+<td></td>
+<td></td>
+<td></td>
+<td></td>
+</tr>
+<tr>
+<td>GIF (Graphics Interchange Format)</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
+<td>X [1]</td>
+<td>X [1]</td>
+<td>X</td>
+<td>X</td>
+<td>X [1]</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
+<td>X [2]</td>
+<td>X [2]</td>
+<td>X</td>
+<td>X</td>
+<td>X [2]</td>
+<td>X</td>
+</tr>
+<tr>
+<td><a href="#wmf">WMF</a> (Windows Metafile)</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+<td>X</td>
+</tr>
+</tbody>
+</table>
+<p>Legend:</p>
+<ul>
+<li>
+<p>[1]: Supported without the need to decode the image.</p>
+</li>
+<li>
+<p>[2]: Supported without the need to decode the image, but only for certain subtypes.</p>
+</li>
+</ul>
+<h1 id="packages">Graphics Packages</h1>
+<h2 id="native">XML Graphics Commons Native</h2>
+<p><a href="http://xmlgraphics.apache.org/commons/">XML Graphics Commons</a> supports a number of graphic file formats natively as basic functionality: all bitmap formats for which there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.</p>
+<h2 id="fop-native">FOP Native</h2>
+<p>FOP has no native image plug-ins for the image loading framework of its own but currently hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to <a href="http://xmlgraphics.apache.org/batik/">Apache Batik</a> .</p>
+<h2 id="batik">Apache Batik</h2>
+<p><a href="http://xmlgraphics.apache.org/batik/">Apache Batik</a> will later receive the SVG and WMF plug-ins for the image loading framework that are currently hosted inside FOP.</p>
+<p>Current FOP distributions include a distribution of the <a href="http://xmlgraphics.apache.org/batik/">Apache Batik</a> . Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP.
+<warning>Batik must be run in a graphical environment.</warning>
+Batik must be run in a graphical environment. It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems. If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail.</p>
+<p>Here are some workarounds:</p>
+<ul>
+<li>
+<p>Start Java with the <code>-Djava.awt.headless=true</code> command line option.</p>
+</li>
+<li>
+<p>Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.</p>
+</li>
+<li>
+<p>Install a toolkit which emulates AWT without the need for an underlying X server. One example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a> , which is free and comes with detailed installation instructions.</p>
+</li>
+</ul>
+<h2 id="imageio">Image I/O</h2>
+<p>The image loading framework in <a href="http://xmlgraphics.apache.org/commons/">XML Graphics Commons</a> provides a wrapper to load images through the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015). Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the <a href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a> available from Sun.</p>
+<h1 id="image-formats">Details on image formats</h1>
+<h2 id="bmp">BMP</h2>
+<p>BMP images are supported through an Image I/O codec. There may be limitations of the codec which are outside the control of Apache FOP.</p>
+<h2 id="emf">EMF</h2>
+<p>Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are embedded without decoding.</p>
+<h2 id="eps">EPS</h2>
+<p>Apache FOP allows to use EPS files when generating PostScript output only.</p>
+<p>Other output targets can't be supported at the moment because FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able to parse the preview bitmaps sometimes contained in EPS files.</p>
+<h2 id="gif">GIF</h2>
+<p>GIF images are supported through an Image&nbsp;I/O codec. Transparency is supported but not guaranteed to work with every output format.</p>
+<h2 id="jpeg">JPEG</h2>
+<p>FOP native support (i.e. the handling of undecoded images) of JPEG does not include all variants, especially those containing unusual color lookup tables and color profiles. If you have trouble with a JPEG image in FOP, try opening it with an image processing program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output may also help. For the PDF and PostScript renderers most JPEG images can be passed through without decompression. User reports indicate that grayscale, RGB, and CMYK color spaces are all rendered properly. However, for other output formats, the JPEG images have to be decompressed. Tests have shown that there are some limitation in some Image&nbsp;I/O codecs concerning images in the CMYK color space. Work-arounds are in place but may not always work as expected.</p>
+<h2 id="png">PNG</h2>
+<p>PNG images are supported through an Image&nbsp;I/O codec. Transparency is supported but not guaranteed to work with every output format.</p>
+<h2 id="svg">SVG</h2>
+<h3 id="svg-intro">Introduction</h3>
+<p>FOP uses <a href="#batik">Apache Batik</a> for SVG support. This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate file referenced with <code>fo:external-graphic</code> .
+Batik's SVG Rasterizer utility may also be used to convert standalone SVG documents into PDF. For more information please see the <a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a> on the Batik site.</p>
+<h3 id="svg-pdf-graphics">Placing SVG Graphics into PDF</h3>
+<p>The SVG is rendered into PDF by using PDF commands to draw and fill lines and curves. This means that the graphical objects created with this remain as vector graphics. The same applies to PostScript output. For other output formats the SVG graphic may be converted to a bitmap image.</p>
+<p>There are a number of SVG things that cannot be converted directly into PDF. Parts of the graphic such as effects, patterns and images are inserted into the PDF as a raster graphic. The resolution of these raster images can be controlled through the "target resolution" setting in the <a href="configuration.html">configuration</a> .</p>
+<p>Currently transparency is limited in PDF so some SVG images that contain effects or graphics with transparent areas may not be displayed correctly.</p>
+<h3 id="svg-pdf-text">Placing SVG Text into PDF and PostScript</h3>
+<p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does this by checking if the text can be drawn normally and the font is supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> / <a href="../dev/svg/text.pdf">text.pdf</a> / <a href="../dev/svg/text.png">text.png</a> shows how various types and effects with text are handled. Note that SVG font support is not yet implemented. Furthermore, text handling in PostScript output is inferior to PDF output - more text will be painted as shapes in PS than in PDF.</p>
+<p>When there's no support to paint text using native text operations, text is converted and drawn as a set of shapes by Batik, using the stroking text painter. This means that a typical character will have about 10 curves (each curve consists of at least 20 characters). This can make the output files large and when it is viewed the viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on "Smooth Line Art" in the preferences will fix this). Copy/paste functionality will not be supported in this case. If the text is inserted into the output file using the inbuilt text commands it will use a single character.</p>
+<p>Note that because SVG text can be rendered as either text or a vector graphic, you may need to consider settings in your viewer for both. The Acrobat viewer has both "smooth line art" and "smooth text" settings that may need to be set for SVG images to be displayed nicely on your screen (see Edit / Preferences / Display). This setting will not affect the printing of your document, which should be OK in any case, but will only affect the quality of the screen display.</p>
+<h3 id="svg-font-selection">Font selection notes</h3>
+<p>Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font subsystem. Great care has been taken that font selection does the best possible choices. But it must be noted when creating PDF or PostScript that a font used in SVG graphics needs to be registered with the operating system as well as in FOP's configuration. By using FOP's font auto-detection, you simply have to install the font in the operating system and not care about anything else. This is less of an issue if you create formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the single font source.</p>
+<p>Whenever an SVG is converted into a PDF or PostScript file, the font that has been used inside Batik has to be mapped to a font used by the actual output format. Features like font substitution in FOP may need to be taken into account but can also be an advantage when working around font mapping issues. Like for XSL-FO content, you'll get a warning if a particular font could not be found and had to be substituted, or if a particular glyph is missing in a font.</p>
+<h3 id="svg-scaling">Scaling</h3>
+<p>Currently, SVG images are rendered with the dimensions specified <em>in the SVG file</em> , within the viewport specified in the fo:external-graphic element. For everything to work properly, the two should be equal. The SVG standard leaves this issue as an implementation detail. Additional scaling options are available through XSL-FO means.</p>
+<p>If you use pixels to specify the size of an SVG graphic the "source resolution" setting in the <a href="configuration.html">configuration</a> will be used to determine the size of a pixel. The use of pixels to specify sizes is discouraged as they may be interpreted differently in different environments.</p>
+<h3 id="svg-problems">Known Problems</h3>
+<ul>
+<li>
+<p>Soft mask transparency is combined with white so that it looks better on PDF 1.3 viewers but this causes the soft mask to be slightly lighter or darker on PDF 1.4 viewers.</p>
+</li>
+<li>
+<p>There is some problem with a gradient inside a pattern which may cause a PDF error when viewed in Acrobat 5.</p>
+</li>
+<li>
+<p>Text is not always handled correctly, it may select the wrong font especially if characters have multiple fonts in the font list.</p>
+</li>
+<li>
+<p>Uniform transparency for images and other SVG elements that are converted into a raster graphic are not drawn properly in PDF. The image is opaque.</p>
+</li>
+</ul>
+<h2 id="tiff">TIFF</h2>
+<p>FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable Image&nbsp;I/O codec is necessary for decoding the image.</p>
+<p>There may be some limitation concerning images in the CMYK color space.</p>
+<h2 id="wmf">WMF</h2>
+<p>Windows Metafiles (WMF) are supported through classes in <a href="http://xmlgraphics.apache.org/batik/">Apache Batik</a> . At the moment, support for this format is experimental and may not always work as expected.</p>
+<h1 id="resolution">Graphics Resolution</h1>
+<p>Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution values. FOP tries to use this resolution information whenever possible to determine the image's intrinsic size. This size is used during the layout process when it is not superseded by an explicit size on fo:external-graphic (content-width and content-height properties).</p>
+<p>Please note that not all images contain resolution information. If it's not available the source resolution set on the FopFactory (or through the user configuration XML) is used. The default here is 72 dpi.</p>
+<p>Bitmap images are generally embedded into the output format at their original resolution (as is). No resampling of the image is performed. Explicit resampling is on our wishlist, but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to the resolution specified in the "target resolution" setting in the <a href="configuration.html">configuration</a> if SVG filters are applied. This can be used as a work-around to resample images in FO documents.</p>
+<h1 id="page-selection">Page selection for multi-page formats</h1>
+<p>Some image formats such as TIFF support multiple pages/sub-images per file. You can select a particular page using a special URI fragment in the form: <uri>#page=<nr> (for example: <code>http://localhost/images/myimage.tiff#page=3</code> )</p>
+<h1 id="caching">Image caching</h1>
+<p>FOP caches images between runs. There is one cache per FopFactory instance. The URI is used as a key to identify images which means that when a particular URI appears again, the image is taken from the cache. If you have a servlet that generates a different image each time it is called with the same URI you need to use a constantly changing dummy parameter on the URI to avoid caching.</p>
+<p>The image cache has been improved considerably in the redesigned code. Therefore, resetting the image cache should be a thing of the past. If you still experience OutOfMemoryErrors, please notify us.</p>
+<p>If all else fails, the image cache can be cleared like this: <code>fopFactory.getImageManager().getCache().clearCache();</code> </p></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,181 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP: Hyphenation</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP: Hyphenation</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<h1 id="support">Hyphenation Support</h1>
+<h2 id="intro">Introduction</h2>
+<p>Apache™ FOP uses Liang's hyphenation algorithm, well known from TeX. It needs language specific pattern and other data for operation.</p>
+<p>Because of <a href="#license-issues">licensing issues</a> (and for convenience), all hyphenation patterns for FOP are made available through the <a href="http://offo.sourceforge.net/hyphenation/index.html">Objects For Formatting Objects</a> project.
+If you have made improvements to an existing FOP hyphenation pattern, or if you have created one from scratch, please consider contributing these to OFFO so that they can benefit other FOP users as well. Please inquire on the <a href="../maillist.html#fop-user">FOP User mailing list</a> .</p>
+<h2 id="license-issues">License Issues</h2>
+<p>Many of the hyphenation files distributed with TeX and its offspring are licenced under the <a href="http://www.latex-project.org/lppl.html">LaTeX Project Public License (LPPL)</a> , which prevents them from being distributed with Apache software. The LPPL puts restrictions on file names in redistributed derived works which we feel can't guarantee. Some hyphenation pattern files have other or additional restrictions, for example against use for commercial purposes.</p>
+<p>Although Apache FOP cannot redistribute hyphenation pattern files that do not conform with its license scheme, that does not necessarily prevent users from using such hyphenation patterns with FOP. However, it does place on the user the responsibility for determining whether the user can rightly use such hyphenation patterns under the hyphenation pattern license.
+<warning>The user is responsible to settle license issues for hyphenation pattern files that are obtained from non-Apache sources.</warning></p>
+<h2 id="sources">Sources of Custom Hyphenation Pattern Files</h2>
+<p>The most important source of hyphenation pattern files is the <a href="http://www.ctan.org/tex-archive/language/hyphenation/">CTAN TeX Archive</a> .</p>
+<h2 id="install">Installing Custom Hyphenation Patterns</h2>
+<p>To install a custom hyphenation pattern for use with FOP:</p>
+<ol>
+<li>
+<p>Convert the TeX hyphenation pattern file to the FOP format. The FOP format is an xml file conforming to the DTD found at <code>{fop-dir}/hyph/hyphenation.dtd</code> .</p>
+</li>
+<li>
+<p>Name this new file following this schema: <code>languageCode_countryCode.xml</code> . The country code is optional, and should be used only if needed. For example:</p>
+</li>
+<li>
+<p><code>en_US.xml</code> would be the file name for American English hyphenation patterns.</p>
+</li>
+<li>
+<p><code>it.xml</code> would be the file name for Italian hyphenation patterns.
+The language and country codes must match the XSL-FO input, which follows <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt">ISO 639</a> (languages) and <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso3166.txt">ISO 3166</a> (countries). NOTE: The ISO 639/ISO 3166 convention is that language names are written in lower case, while country codes are written in upper case. FOP does not check whether the language and country specified in the FO source are actually from the current standard, but it relies on it being two letter strings in a few places. So you can make up your own codes for custom hyphenation patterns, but they should be two letter strings too (patches for proper handling extensions are welcome)</p>
+</li>
+<li>
+<p>There are basically three ways to make the FOP-compatible hyphenation pattern file(s) accessible to FOP:</p>
+</li>
+<li>
+<p>Download the precompiled JAR from <a href="http://offo.sourceforge.net/hyphenation/index.html">OFFO</a> and place it either in the <code>{fop-dir}/lib</code> directory, or in a directory of your choice (and append the full path to the JAR to the environment variable <code>FOP_HYPHENATION_PATH</code> ).</p>
+</li>
+<li>
+<p>Download the desired FOP-compatible hyphenation pattern file(s) from <a href="http://offo.sourceforge.net/hyphenation/index.html">OFFO</a> , and/or take your self created hyphenation pattern file(s),</p>
+<ul>
+<li>
+<p>place them in the directory <code>{fop-dir}/hyph</code> ,</p>
+</li>
+<li>
+<p>or place them in a directory of your choice and set the Ant variable <code>user.hyph.dir</code> to point to that directory (in <code>build-local.properties</code> ),
+and run Ant with build target <code>jar-hyphenation</code> . This will create a JAR containing the compiled patterns in <code>{fop-dir}/build</code> that will be added to the classpath on the next run. (When FOP is built from scratch, and there are pattern source file(s) present in the directory pointed to by the <code>user.hyph.dir</code> variable, this JAR will automatically be created from the supplied pattern(s)).</p>
+</li>
+</ul>
+</li>
+<li>
+<p>Put the pattern source file(s) into a directory of your choice and configure FOP to look for custom patterns in this directory, by setting the <a href="configuration.html"><hyphenation-base></a> configuration option.</p>
+</li>
+</ol>
+<p><warning>Either of these three options will ensure hyphenation is working when using FOP from the command-line. If FOP is being embedded, remember to add the location(s) of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the <a href="configuration.html#hyphenation-dir"><hyphenation-dir></a> configuration option programmatically (option 3).</warning></p>
+<h1 id="patterns">Hyphenation Patterns</h1>
+<p>If you would like to build your own hyphenation pattern files, or modify existing ones, this section will help you understand how to do so. Even when creating a pattern file from scratch, it may be beneficial to start with an existing file and modify it. See <a href="http://offo.sourceforge.net/hyphenation/index.html">OFFO's Hyphenation page</a> for examples. Here is a brief explanation of the contents of FOP's hyphenation patterns:
+<warning>The remaining content of this section should be considered "draft" quality. It was drafted from theoretical literature, and has not been tested against actual FOP behavior. It may contain errors or omissions. Do not rely on these instructions without testing everything stated here. If you use these instructions, please provide feedback on the <a href="../maillist.html#fop-user">FOP User mailing list</a> , either confirming their accuracy, or raising specific problems that we can address.</warning></p>
+<ul>
+<li>
+<p>The root of the pattern file is the <hyphenation-info> element.</p>
+</li>
+<li>
+<p><hyphen-char>: its attribute "value" contains the character signalling a hyphen in the <exceptions> section. It has nothing to do with the hyphenation character used in FOP, use the XSLFO hyphenation-character property for defining the hyphenation character there. At some points a dash U+002D is hardwired in the code, so you'd better use this too (patches to rectify the situation are welcome). There is no default, if you declare exceptions with hyphenations, you must declare the hyphen-char too.</p>
+</li>
+<li>
+<p><hyphen-min> contains two attributes:</p>
+<ul>
+<li>
+<p>before: the minimum number of characters in a word allowed to exist on a line immediately preceding a hyphenated word-break.</p>
+</li>
+<li>
+<p>after: the minimum number of characters in a word allowed to exist on a line immediately after a hyphenated word-break.
+This element is unused and not even read. It should be considered a documentation for parameters used during pattern generation.</p>
+</li>
+</ul>
+</li>
+<li>
+<p><classes> contains whitespace-separated character sets. The members of each set should be treated as equivalent for purposes of hyphenation, usually upper and lower case of the same character. The first character of the set is the canonical character, the patterns and exceptions should only contain these canonical representation characters (except digits for weight, the period (.) as word delimiter in the patterns and the hyphen char in exceptions, of course).</p>
+</li>
+<li>
+<p><exceptions> contains whitespace-separated words, each of which has either explicit hyphen characters to denote acceptable breakage points, or no hyphen characters, to indicate that this word should never be hyphenated, or contain explicit <hyp> elements for specifying changes of spelling due to hyphenation (like backen -&gt; bak-ken or Stoffarbe -&gt; Stoff-farbe in the old german spelling). Exceptions override the patterns described below. Explicit <hyp> declarations don't work yet (patches welcome). Exceptions are generally a bit brittle, test carefully.</p>
+</li>
+<li>
+<p><patterns> includes whitespace-separated patterns, which are what drive most hyphenation decisions. The characters in these patterns are explained as follows:</p>
+<ul>
+<li>
+<p>non-numeric characters represent characters in a sub-word to be evaluated</p>
+</li>
+<li>
+<p>the period character (.) represents a word boundary, i.e. either the beginning or ending of a word</p>
+</li>
+<li>
+<p>numeric characters represent a scoring system for indicating the acceptability of a hyphen in this location. Odd numbers represent an acceptable location for a hyphen, with higher values overriding lower inhibiting values. Even numbers indicate an unacceptable location, with higher values overriding lower values indicating an acceptable position. A value of zero (inhibiting) is implied when there is no number present. Generally patterns are constructed so that valuse greater than 4 are rare. Due to a bug currently patterns with values of 8 and greater don't have an effect, so don't wonder.
+Here are some examples from the English patterns file:</p>
+</li>
+<li>
+<p>Knuth ( <em>The TeXBook</em> , Appendix H) uses the example <strong>hach4</strong> , which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".</p>
+</li>
+<li>
+<p><strong>.leg5e</strong> indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
+Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the <em>highest</em> value found for letter combination.</p>
+</li>
+</ul>
+</li>
+</ul>
+<p>If you want to convert a TeX hyphenation pattern file, you have to undo the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns must be proper Unicode too. You should be aware of the XML encoding issues, preferably use a good Unicode editor.</p>
+<p>Note that FOP does not do Unicode character normalization. If you use combining chars for accents and other character decorations, you must declare character classes for them, and use the same sequence of base character and combining marks in the XSLFO source, otherwise the pattern wouldn't match. Fortunately, Unicode provides precomposed characters for all important cases in common languages, until now nobody run seriously into this issue. Some dead languages and dialects, especially ancient ones, may pose a real problem though.</p>
+<p>If you want to generate your own patterns, an open-source utility called patgen is available on many Unix/Linux distributions and every TeX distribution which can be used to assist in creating pattern files from dictionaries. Pattern creation for languages like english or german is an art. If you can, read Frank Liang's original paper "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available online. The original patgen.web source, included in the TeX source distributions, contains valuable comments, unfortunately technical details obscure often the high level issues. Another important source is <a href="http://www.ctan.org/tex-archive/systems/knuth/tex/texbook.tex">The TeX Book</a> , appendix H (either read the TeX source, or run it through TeX to typeset it). Secondary articles, for example the works by Petr Sojka, may also give some much needed insight into problems arising in automated hyphenation.</p></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleFO2PDF.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleFO2PDF.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleObj2PDF.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleObj2PDF.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleObj2XML.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleObj2XML.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleXML2FO.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleXML2FO.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleXML2PDF.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/EmbeddingExampleXML2PDF.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/if-architecture-overview.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/xmlgraphics/trunk/content/fop/1.0/images/if-architecture-overview.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html Sun Apr 15 05:39:50 2012
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <title>Apache™ FOP Version 1.0</title>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/code.css">
+-->
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css">
+
+    </style>
+
+    
+
+    
+    
+  </head>
+
+  <body>
+	  <div id="banner">&nbsp;
+	  </div>
+
+	  <div id="navigation">
+	  <h1 id="xml-graphics">XML Graphics</h1>
+<ul>
+<li><a href="/">Overview</a></li>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+</ul>
+<h1 id="subprojects">Subprojects</h1>
+<ul>
+<li><a href="/batik/">Batik</a></li>
+<li><a href="/fop/">FOP</a></li>
+<li><a href="/commons/">Commons</a></li>
+</ul>
+<form name="search" id="search" action="http://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" /><br />
+  <input type="submit" id="submit" value="Search" />
+</form>
+	  </div>
+	
+	  <div id="bannertext">
+        <a href="/"><img src="/images/apache-xml-graphics.gif" alt="The Apache XML Graphics Project" width="220" heigh="51" /></a>
+        <h1>Apache™ FOP Version 1.0</h1>
+      </div>
+        <p><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/1.0/">1.0</a></p>
+      </div>
+      <div id="content" class="grid_16"><div class="section-content"><p><version>$Revision: 1298724 $</version></p>
+<h1 id="intro">Introduction</h1>
+<p>The Apache™ FOP team is proud to present to you this production quality codebase. FOP 1.0 provides a good subset of the W3C XSL-FO 1.0 and 1.1 Standards. Its stable, 1.0 designation provides added recognition as the productive tool it has been for years.</p>
+<p>We remain committed to improving the tool, and we continue to add new features. We welcome any feedback you might have and even more, any other form of help to get the project forward.</p>
+<p>This release contains many bug fixes and new features compared to the previous version. To see what has changed since the last release, please visit the <a href="changes_1.0.html">Changes Page</a> and the <a href="releaseNotes_1.0.html">Release Notes</a> .</p>
+<p>This release implements a good subset of the W3C XSL-FO 1.0 and 1.1 Standards. For a detailed overview of FOP's compliance, visit the <a href="../compliance.html">compliance page</a> .</p>
+<h1 id="upgrading">Upgrading from an earlier version</h1>
+<p>If you're upgrading to this version from an earlier version of FOP, please read the information contained on the <a href="upgrading.html">Upgrading page</a> !</p>
+<h1 id="download">Download</h1>
+<p>To download this version, please visit the <a href="../download.html">download page</a> .</p></div></div>
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<a alt="Apache Software Foundation" href="http://www.apache.org">
+		  <img id="asf-logo" alt="Apache Software Foundation" src="/images/feather-small.gif"/ width="100">
+		</a>
+		<div class="copyright">
+		  <p>
+			Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, the Apache feather logo, and the Apache XML Graphics logos are
+			trademarks of <a href="http://www.apache.org">The Apache Software Foundation</a>. All other
+			marks mentioned may be trademarks or registered trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+  </body>
+</html>



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


Mime
View raw message