Return-Path: X-Original-To: apmail-xmlgraphics-commits-archive@www.apache.org Delivered-To: apmail-xmlgraphics-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F1C4D83B for ; Mon, 3 Dec 2012 05:00:01 +0000 (UTC) Received: (qmail 42978 invoked by uid 500); 3 Dec 2012 05:00:01 -0000 Mailing-List: contact commits-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list commits@xmlgraphics.apache.org Received: (qmail 42923 invoked by uid 99); 3 Dec 2012 05:00:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 05:00:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 04:59:47 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AE16A2388A5E for ; Mon, 3 Dec 2012 04:59:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r840438 [1/6] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/ fop/0.95/ fop/1.0/ fop/1.1/ fop/dev/ fop/dev/design/ Date: Mon, 03 Dec 2012 04:59:21 -0000 To: commits@xmlgraphics.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121203045924.AE16A2388A5E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Mon Dec 3 04:59:19 2012 New Revision: 840438 Log: Staging update by buildbot for xmlgraphics Modified: websites/staging/xmlgraphics/trunk/content/ (props changed) websites/staging/xmlgraphics/trunk/content/fop/0.95/anttask.html websites/staging/xmlgraphics/trunk/content/fop/0.95/configuration.html websites/staging/xmlgraphics/trunk/content/fop/0.95/extensions.html websites/staging/xmlgraphics/trunk/content/fop/0.95/fonts.html websites/staging/xmlgraphics/trunk/content/fop/0.95/metadata.html websites/staging/xmlgraphics/trunk/content/fop/0.95/output.html websites/staging/xmlgraphics/trunk/content/fop/1.0/accessibility.html websites/staging/xmlgraphics/trunk/content/fop/1.0/anttask.html websites/staging/xmlgraphics/trunk/content/fop/1.0/configuration.html websites/staging/xmlgraphics/trunk/content/fop/1.0/extensions.html websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html websites/staging/xmlgraphics/trunk/content/fop/1.0/metadata.html websites/staging/xmlgraphics/trunk/content/fop/1.1/anttask.html websites/staging/xmlgraphics/trunk/content/fop/1.1/complexscripts.html websites/staging/xmlgraphics/trunk/content/fop/1.1/configuration.html websites/staging/xmlgraphics/trunk/content/fop/1.1/metadata.html websites/staging/xmlgraphics/trunk/content/fop/dev/conventions.html websites/staging/xmlgraphics/trunk/content/fop/dev/design/embedding.html websites/staging/xmlgraphics/trunk/content/fop/dev/doc.html websites/staging/xmlgraphics/trunk/content/fop/dev/release.html websites/staging/xmlgraphics/trunk/content/fop/dev/testing.html websites/staging/xmlgraphics/trunk/content/fop/dev/tools.html websites/staging/xmlgraphics/trunk/content/fop/fo.html websites/staging/xmlgraphics/trunk/content/fop/fop-pdf-images.html websites/staging/xmlgraphics/trunk/content/fop/license.html websites/staging/xmlgraphics/trunk/content/fop/maillist.html websites/staging/xmlgraphics/trunk/content/fop/quickstartguide.html websites/staging/xmlgraphics/trunk/content/fop/resources.html Propchange: websites/staging/xmlgraphics/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Mon Dec 3 04:59:19 2012 @@ -1 +1 @@ -1416346 +1416347 Modified: websites/staging/xmlgraphics/trunk/content/fop/0.95/anttask.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/0.95/anttask.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/0.95/anttask.html Mon Dec 3 04:59:19 2012 @@ -386,23 +386,23 @@ Then create FOP tasks within your Ant bu The following example converts a single XSL-FO file to a PDF document: - - - + + + This example converts all XSL-FO files within an entire directory to PostScript: - - - - - - - + + + + + + +
Modified: websites/staging/xmlgraphics/trunk/content/fop/0.95/configuration.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/0.95/configuration.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/0.95/configuration.html Mon Dec 3 04:59:19 2012 @@ -341,11 +341,11 @@ $(document).ready(function () {
-

Apache™ FOP: Configuration

-

Configuration File Basics

+

Apache™ FOP: Configuration

+

Configuration File Basics

The FOP configuration file is an XML file containing a variety of settings that are useful for controlling FOP's behavior, and for helping it find resources that you wish it to use.

The easiest way to get started using a FOP configuration file is to copy the sample found at {fop-dir}/conf/fop.xconf to a location of your choice, and then to edit it according to your needs. It contains templates for the various configuration options, most of which are commented out. Remove the comments and change the settings for entries that you wish to use. Be sure to follow any instructions, including comments which specify the value range. Also, since the configuration file is XML, be sure to keep it well-formed.

-

Making Configuration Available to FOP

+

Making Configuration Available to FOP

After creating your configuration file, you must tell FOP how to find it:

  • @@ -356,7 +356,7 @@ $(document).ready(function () {

See Setting the Configuration Programmatically for instructions on how to do so in an embedded environment.

-

Summary of the General Configuration Options

+

Summary of the General Configuration Options

@@ -442,117 +442,131 @@ $(document).ready(function () {

This is an excerpt from the example configuration file coming with FOP:

-

-

- true

-

- true

-

- ./

-

- ./

-

- 72 - - 72

-

-

-

-

-

Renderer configuration

+
<fop version="1.0">
+
+  <!-- Strict user configuration -->
+  <strict-configuration>true</strict-configuration>
+
+  <!-- Strict FO validation -->
+  <strict-validation>true</strict-validation>
+
+  <!-- Base URL for resolving relative URLs -->
+  <base>./</base>
+
+  <!-- Font Base URL for resolving relative font URLs -->
+  <font-base>./</font-base>
+
+  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
+  <source-resolution>72</source-resolution>
+  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
+  <target-resolution>72</target-resolution>
+
+  <!-- default page-height and page-width, in case
+       value is specified as auto -->
+  <default-page-settings height="11in" width="8.26in"/>
+
+  <!-- etc. etc..... -->
+</fop>
+
+ + +

Renderer configuration

Each Renderer has its own configuration section which is identified by the MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.

The configuration for the PDF Renderer could look like this:

-

- - - - flate - - - - - - - - - - - -

-
<renderer mime="application/postscript">
-<!-- etc. etc..... -->
+
  <renderers>
+    <renderer mime="application/pdf">
+      <filterList>
+        <!-- provides compression using zlib flate (default is on) -->
+        <value>flate</value>
+      </filterList>
+      <fonts>
+        <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
+          <font-triplet name="Arial" style="normal" weight="normal"/>
+          <font-triplet name="ArialMT" style="normal" weight="normal"/>
+        </font>
+        <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
+          <font-triplet name="Arial" style="normal" weight="bold"/>
+          <font-triplet name="ArialMT" style="normal" weight="bold"/>
+        </font>
+      </fonts>
+    </renderer>
+
+    <renderer mime="application/postscript">
+    <!-- etc. etc..... -->
 

The details on the font configuration can be found on the separate Fonts page. Note especially the section entitled Register Fonts with FOP .

-

Special Settings for the PDF Renderer

+

Special Settings for the PDF Renderer

The configuration element for the PDF renderer contains two elements. One is for the font configuration (please follow the link above) and one is for the "filter list". The filter list controls how the individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that setting. For debugging purposes, it may be desired not to compress the internal objects at all so the generated PDF commands can be read. In that case, you can simply use the following filter list. The second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded so the produced PDF file is still easily readable in a text editor.

-
<renderer mime="application/pdf">
-  <filterList>
-    <value>null</value>
-  </filterList>
-  <filterList type="image">
-    <value>flate</value>
-    <value>ascii-85</value>
-  </filterList>
+
    <renderer mime="application/pdf">
+      <filterList>
+        <value>null</value>
+      </filterList>
+      <filterList type="image">
+        <value>flate</value>
+        <value>ascii-85</value>
+      </filterList>
 
-  <fonts....
-</renderer>
+      <fonts....
+    </renderer>
 

Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC color profile which indicates the target color space the PDF file is generated for. This setting is mainly used in conjunction with the PDF/X feature. An example:

-
<renderer mime="application/pdf">
-  <filterList...
+
    <renderer mime="application/pdf">
+      <filterList...
 
-  <output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
+      <output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
 
-  <fonts....
-  </renderer>
+      <fonts....
+      </renderer>
 

Some people don't have high requirements on color fidelity but instead want the smallest PDF file sizes possible. In this case it's possible to disable the default sRGB color space which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB. Please note that this option is unavailable (and will cause an error) if you enable PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the PDF about 4KB smaller. To disable the sRGB color space add the following setting:

-
<renderer mime="application/pdf">
-  <filterList...
+
    <renderer mime="application/pdf">
+      <filterList...
 
-  <disable-srgb-colorspace>true</disable-srgb-colorspace>
+      <disable-srgb-colorspace>true</disable-srgb-colorspace>
 
-  <fonts....
-  </renderer>
+      <fonts....
+      </renderer>
 
-

Special Settings for the PostScript Renderer

+

Special Settings for the PostScript Renderer

Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false". Example:

-
<renderer mime="application/postscript">
-  <auto-rotate-landscape>true</auto-rotate-landscape>
+
    <renderer mime="application/postscript">
+      <auto-rotate-landscape>true</auto-rotate-landscape>
 
-  <fonts>
-    <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
-      <font-triplet name="Arial" style="normal" weight="normal"/>
-      <font-triplet name="ArialMT" style="normal" weight="normal"/>
-    </font>
-    <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
-      <font-triplet name="Arial" style="normal" weight="bold"/>
-      <font-triplet name="ArialMT" style="normal" weight="bold"/>
-    </font>
-  </fonts>
-</renderer>
+      <fonts>
+        <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
+          <font-triplet name="Arial" style="normal" weight="normal"/>
+          <font-triplet name="ArialMT" style="normal" weight="normal"/>
+        </font>
+        <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
+          <font-triplet name="Arial" style="normal" weight="bold"/>
+          <font-triplet name="ArialMT" style="normal" weight="bold"/>
+        </font>
+      </fonts>
+    </renderer>
 
-

Special Settings for the PCL Renderer

+

Special Settings for the PCL Renderer

Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that you don't have to do any custom font configuration in this case but you have to use the font names offered by Java.

-

Additionally, there are certain settings that control how the renderer handles various elements. - - quality - bitmap - -The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.

+

Additionally, there are certain settings that control how the renderer handles various elements.

+
<renderer mime="application/vnd.hp-PCL">
+  <rendering>quality</rendering>
+  <text-rendering>bitmap</text-rendering>
+</renderer>
+
+ + +

The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.

The default value for the "text-rendering" setting is "auto" which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to "bitmap" which causes all text to be rendered as bitmaps.

-

When it does not work

+

When it does not work

FOP searches the configuration file for the information it expects, at the position it expects. When that information is not present, FOP will not complain, it will just continue. When there is other information in the file, FOP will not complain, it will just ignore it. That means that when your configuration information is in the file but in a different XML element, or in a different XML path, than FOP expects, it will be silently ignored.

Check the following possibilities:

    @@ -560,15 +574,16 @@ The default value for the "rendering" se

    The format of the configuration file has changed considerably between FOP 0.20.5 and FOP 1.0 and its beta versions. Did you convert your file to the new format?

  • -

    The FOP distribution contains a schema for configuration files, at src/foschema/fop-configuration.xsd. Did you validate your configuration file against it? Add the following schema location to the schema element: -and run the configuration file through a validating schema parser. Note that the schema cannot detect all errors, and that it is stricter about the order of some elements than FOP itself is.

    -
  • -
  • -

    Run FOP in debug mode (command line option -d ). This makes FOP report which configuration information it finds. Check if FOP finds what you expect.

    +

    The FOP distribution contains a schema for configuration files, at src/foschema/fop-configuration.xsd. Did you validate your configuration file against it? Add the following schema location to the schema element:

    +

  • +
+

and run the configuration file through a validating schema parser. Note that the schema cannot detect all errors, and that it is stricter about the order of some elements than FOP itself is.

+
    +
  • Run FOP in debug mode (command line option -d ). This makes FOP report which configuration information it finds. Check if FOP finds what you expect.
Modified: websites/staging/xmlgraphics/trunk/content/fop/0.95/extensions.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/0.95/extensions.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/0.95/extensions.html Mon Dec 3 04:59:19 2012 @@ -341,34 +341,40 @@ $(document).ready(function () {
-

Standard Apache™ FOP Extensions

+

Standard Apache™ FOP Extensions

By "extension", we mean any data that can be placed in the input XML document that is not addressed by the XSL-FO standard. By having a mechanism for supporting extensions, FOP is able to add features that are not covered in the specification.

The extensions documented here are included with FOP, and are automatically available to you. If you wish to add an extension of your own to FOP, please see the Developers' Extension Page . All extensions require the correct use of an appropriate namespace in your input document.

-

SVG

+

SVG

Please see the SVG documentation for more details.

-

FO Extensions

-

Namespace

-

By convention, FO extensions in FOP use the "fox" namespace prefix. To use any of the FO extensions, add a namespace entry for http://xmlgraphics.apache.org/fop/extensions to the root element: -

-

PDF Bookmarks

+

FO Extensions

+

Namespace

+

By convention, FO extensions in FOP use the "fox" namespace prefix. To use any of the FO extensions, add a namespace entry for http://xmlgraphics.apache.org/fop/extensions to the root element:

+
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+           xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+
+ + +

PDF Bookmarks

In previous versions of Apache FOP there was a fox:outline element which was used to create outlines in PDF files. The redesigned code makes use of the new bookmark feature defined in the latest XSL 1.1 working draft .

-

Anchors or Named Destinations

-

Use the fox:destination element to define "named destinations" inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name. - +

Anchors or Named Destinations

+

Use the fox:destination element to define "named destinations" inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name.

+
<fox:destination internal-destination="table-of-contents"/>
 ...
-Table of ContentsIt is possible that in some future release of FOP, all elements with "id" attributes will generate named-destinations, which will eliminate the need for fox:destination.

-

Table Continuation Label

+<fo:block id="table-of-contents">Table of Contents</fo:block><warning>It is possible that in some future release of FOP, *all* elements with "id" attributes will generate named-destinations, which will eliminate the need for fox:destination.</warning> +
+ + +

Table Continuation Label

This extension element hasn't been reimplemented for the redesigned code, yet.

-

fox:orphan-content-limit and fox:widow-content-limit

+

fox:orphan-content-limit and fox:widow-content-limit

The two proprietary extension properties, fox:orphan-content-limit and fox:widow-content-limit, are used to improve the layout of list-blocks and tables. If you have a table with many entries, you don't want a single row to be left over on a page. You will want to make sure that at least two or three lines are kept together. The properties take an absolute length which specifies the area at the beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a table or list-block. The properties are inherited and only have an effect on fo:table and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure the you'll have at least three lines (assuming line-height="1.2") together on a table or list-block.

-

fox:external-document

+

fox:external-document

This feature is incomplete. Support for multi-page documents will be added shortly. At the moment, only single-page images will work. And this will not work with RTF output. This is a proprietary extension element which allows to add whole images as pages to an FO document. For example, if you have a scanned document or a fax as multi-page TIFF file, you can append or insert this document using the fox:external-document element. Each page of the external document will create one full page in the target format.

The fox:external-document element is structurally a peer to fo:page-sequence , so wherever you can put an fo:page-sequence you could also place a fox:external-document . Therefore, the specified contents for fo:root change to:

(layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)

-

Specification ##

+

Specification ##

The fox:external-document extension formatting object is used to specify how to create a (sub-)sequence of pages within a document. The content of these pages comes from the individual subimages/pages of an image or paged document (for example: multi-page TIFF in the form of faxes or scanned documents, or PDF files). The formatting object creates the necessary areas to display one image per page.

In terms of page numbers, the behaviour is the same as for fo:page-sequence . The placement of the image inside the page is similar to that of fo:external-graphic or fo:instream-foreign-object , i.e. the viewport (and therefore the page size) is defined by either the intrinsic size of the image or by the size properties that apply to this formatting object.

Content: EMPTY

@@ -431,13 +437,13 @@ This is a proprietary extension element

Datatype "page-set": Value: auto | , Default: "auto" which means all pages/subimages of the document. allows values such as "7" or "1-3" fox:external-document is not suitable for concatenating FO documents. For this, XInclude is recommended.

-

Free-form Transformation for fo:block-container

+

Free-form Transformation for fo:block-container

For fo:block-container elements whose absolute-position set to "absolute" or "fixed" you can use the extension attribute fox:transform to apply a free-form transformation to the whole block-container. The content of the fox:transform attribute is the same as for SVG's transform attribute . The transformation specified here is performed in addition to other implicit transformations of the block-container (resulting from top, left and other properties) and after them.

Examples: fox:transform="rotate(45)" would rotate the block-container by 45 degrees clock-wise around its upper-left corner. fox:transform="translate(10000,0)" would move the block-container to the right by 10 points (=10000 millipoints, FOP uses millipoints internally!). This extension attribute doesn't work for all output formats! It's currently only supported for PDF, PS and Java2D-based renderers.

-

Color functions

+

Color functions

XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions. Apache FOP provides additional color functions for special use cases. Please note that using these functions compromises the interoperability of an FO document.

-

cmyk() ##

+

cmyk() ##

color cmyk(numeric, numeric, numeric, numeric)

This function will construct a color in device-specific CMYK color space. The numbers must be between 0.0 and 1.0. For output formats that don't support device-specific color space the CMYK value is converted to an sRGB value.

Modified: websites/staging/xmlgraphics/trunk/content/fop/0.95/fonts.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/0.95/fonts.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/0.95/fonts.html Mon Dec 3 04:59:19 2012 @@ -341,9 +341,9 @@ $(document).ready(function () {
-

Apache™ FOP: Fonts

+

Apache™ FOP: Fonts

-

Summary

+

Summary

The following table summarizes the font capabilities of the various FOP renderers:

@@ -421,15 +421,15 @@ $(document).ready(function () {
-

Base-14 Fonts

+

Base-14 Fonts

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.

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.

-

Missing Fonts

+

Missing Fonts

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).

-

Java2D/AWT/Operating System Fonts

+

Java2D/AWT/Operating System Fonts

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.

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.

-

Custom Fonts

+

Custom Fonts

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 output formats .

Prior to FOP version 0.94, 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 is still necessary if you want to use a TrueType Collection (*.ttc). Direct support for TrueType collections may be added later. Furthermore, the XML font metrics files are still required if you don't want to embed, but only reference a font.

Basic information about fonts can be found at:

@@ -441,20 +441,26 @@ $(document).ready(function () {

Adobe Font Technote

-

Basic font configuration

+

Basic font configuration

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.

-

- - C:\MyFonts1

-

- C:\MyFonts2

-

-
-Review the documentation for FOP Configuration 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.

-

Advanced font configuration

+
<fonts>
+  <!-- register all the fonts found in a directory -->
+  <directory>C:\MyFonts1</directory>
+
+  <!-- register all the fonts found in a directory
+       and all of its sub directories (use with care) -->
+  <directory recursive="true">C:\MyFonts2</directory>
+
+  <!-- automatically detect operating system installed fonts -->
+  <auto-detect/>  
+</fonts>
+
+ + +

Review the documentation for FOP Configuration 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.

+

Advanced font configuration

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.

-

Type 1 Font Metrics

+

Type 1 Font Metrics

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:

Windows: java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar @@ -467,7 +473,7 @@ PFMReader [options]:

  • -fn 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.
  • -

    TrueType Font Metrics

    +

    TrueType Font Metrics

    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] @@ -524,22 +530,28 @@ TTFReader [options]:

    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

    -

    Register Fonts with FOP

    +

    Register Fonts with FOP

    You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration . Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:

    -

    - - - -

    -

    - C:\MyFonts1

    -

    - C:\MyFonts2

    -

    -
    -

    +
    <fonts>
    +  <!-- register a particular font -->
    +  <font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
    +      embed-url="file:///C:/myfonts/FTL_____.pfb">
    +     <font-triplet name="FrutigerLight" style="normal" weight="normal"/>
    +  </font>
    +
    +  <!-- register all the fonts found in a directory -->
    +  <directory>C:\MyFonts1</directory>
    +
    +  <!-- register all the fonts found in a directory
    +       and all of its sub directories (use with care) -->
    +  <directory recursive="true">C:\MyFonts2</directory>
    +
    +  <!-- automatically detect operating system installed fonts -->
    +  <auto-detect/>  
    +</fonts>
    +
    + +
    • 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 FOP: Configuration for more information.

      @@ -575,7 +587,7 @@ java -cp build\fop.jar;lib\avalon-framew

      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.

    -

    Auto-Detect and auto-embedd feature

    +

    Auto-Detect and auto-embedd feature

    When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.

    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

    @@ -585,7 +597,7 @@ Manifest-Version: 1.0

    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.

    -

    Embedding

    +

    Embedding

    The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.The font is simply embedded into the PDF file, it is not converted. Font embedding is enabled in the userconfig.xml file and 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. Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set. Modified: websites/staging/xmlgraphics/trunk/content/fop/0.95/metadata.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/0.95/metadata.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/0.95/metadata.html Mon Dec 3 04:59:19 2012 @@ -341,15 +341,39 @@ $(document).ready(function () {

    -

    Apache™ FOP: Metadata

    -

    Overview

    +

    Apache™ FOP: Metadata

    +

    Overview

    Document metadata is an important tool for categorizing and finding documents. Various formats support different kinds of metadata representation and to different levels. One of the more popular and flexible means of representing document or object metadata is XMP (eXtensible Metadata Platform, specified by Adobe) . PDF 1.4 introduced the use of XMP. The XMP specification lists recommendation for embedding XMP metdata in other document and image formats. Given its flexibility it makes sense to make use this approach in the XSL-FO context. Unfortunately, unlike SVG which also refers to XMP, XSL-FO doesn't recommend a preferred way of specifying document and object metadata. Therefore, there's no portable way to represent metadata in XSL-FO documents. Each implementation does it differently.

    -

    Embedding XMP in an XSL-FO document

    +

    Embedding XMP in an XSL-FO document

    As noted above, there's no officially recommended way to embed metadata in XSL-FO. Apache™ FOP supports embedding XMP in XSL-FO. Currently, only support for document-level metadata is implemented. Object-level metadata will be implemented when there's interest.

    Document-level metadata can be specified in the fo:declarations element. XMP specification recommends to use x:xmpmeta , rdf:RDF , and rdf:Description elements as shown in example below. Both x:xmpmeta and rdf:RDF elements are recognized as the top-level element introducing an XMP fragment (as per the XMP specification).

    -

    Example

    -

    -

    Implementation in Apache FOP

    +

    Example

    +
    [..]
    +</fo:layout-master-set>
    +<fo:declarations>
    +  <x:xmpmeta xmlns:x="adobe:ns:meta/">
    +    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    +      <rdf:Description rdf:about=""
    +          xmlns:dc="http://purl.org/dc/elements/1.1/">
    +        <!-- Dublin Core properties go here -->
    +        <dc:title>Document title</dc:title>
    +        <dc:creator>Document author</dc:creator>
    +        <dc:description>Document subject</dc:description>
    +      </rdf:Description>
    +      <rdf:Description rdf:about=""
    +          xmlns:xmp="http://ns.adobe.com/xap/1.0/">
    +        <!-- XMP properties go here -->
    +        <xmp:CreatorTool>Tool used to make the PDF</xmp:CreatorTool>
    +      </rdf:Description>
    +    </rdf:RDF>
    +  </x:xmpmeta>
    +</fo:declarations>
    +<fo:page-sequence ...
    +[..] `fo:declarations`  **must** be declared after `fo:layout-master-set` and before the first `page-sequence` .
    +
    + + +

    Implementation in Apache FOP

    Currently, XMP support is only available for PDF output.

    Originally, you could set some metadata information through FOP's FOUserAgent by using its set*() methods (like setTitle(String) or setAuthor(String). These values are directly used to set value in the PDF Info object. Since PDF 1.4, adding metadata as an XMP document to a PDF is possible. That means that there are now two mechanisms in PDF that hold metadata.

    Apache FOP now synchronizes the Info and the Metadata object in PDF, i.e. when you set the title and the author through the FOUserAgent, the two values will end up in the (old) Info object and in the new Metadata object as XMP content. If instead of FOUserAgent, you embed XMP metadata in the XSL-FO document (as shown above), the XMP metadata will be used as-is in the PDF Metadata object and some values from the XMP metadata will be copied to the Info object to maintain backwards-compatibility for PDF readers that don't support XMP metadata.

    @@ -442,7 +466,7 @@ $(document).ready(function () {

    Please refer to the XMP Specification for information on other metadata namespaces.

    Property sets (Namespaces) not listed here are simply passed through to the final document (if supported). That is useful if you want to specify a custom metadata schema.

    - +
    • Adobe's Extensible Metadata Platform (XMP) website

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