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 @@ + + + + Apache™ FOP: Fonts + + + + + + + + + + + + + + + + + + + +
+ The Apache XML Graphics Project +

Apache™ FOP: Fonts

+
+

Home » Fop » 1.0

+ +

$Revision: 1298724 $

+

Summary

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RendererBase-14AWT/OSCustomCustom Embedding
PDFyesnoyesyes
PostScriptyesnoyesyes
PCLyes (modified)yes (painted as bitmaps)yes (painted as bitmaps)no
AFPnonoyesyes
Java2D/AWT/Bitmapif available from OSyesyesn/a (display only)
Printif available from OSyesyescontrolled by OS printer driver
RTFn/a (font metrics not needed)n/an/an/a
TXTyes (used for layout but not for output)noyes (used for layout but not for output)no
XMLyesnoyesn/a
+

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.

+

The following font family names are hard-coded into FOP for the Base-14 font set:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base-14 fontfont families
HelveticaHelvetica, sans-serif, SansSerif
TimesTimes, Times Roman, Times-Roman, serif, any
CourierCourier, monospace, Monospaced
SymbolSymbol
ZapfDingbatsZapfDingbats
+

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

+

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

+

Missing Glyphs

+

Every font contains a particular set of glyphs . 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.

+

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

+

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 .

+

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.

+

Basic information about fonts can be found at:

+ +

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

+
     <!-- 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

+

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 + 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]:

+ +

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] + C:\myfonts\cmr10.ttf ttfcm.xml +TTFReader [options]:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IssueWinAnsiCID-keyed
Usable Character SetLimited to WinAnsi character set, which is roughly equivalent to iso-8889-1.Limited only by the characters in the font itself.
Embedding the FontOptional.Mandatory. Not embedding the font produces invalid PDF documents.
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.
## TrueType Collections
+

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.

+

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.

+

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: + + +

+

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:

+

+ + + + + +

+
     <!-- 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>
+
+ + +

+

+ +

Auto-Detect and auto-embed 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

+
      Name: font/myfont.ttf
+      Content-Type: application/x-font
+
+ + +

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

+

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.

+

There are two different ways how you can specify that a font should be referenced:

+
    +
  1. +

    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.

    +
  2. +
  3. +

    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:

    +
  4. +
+

+ + + + + + + +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 package . 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 font-family=".*" .

+

The referenced-fonts element can be placed either inside the general fonts element (right under the root) or in the fonts 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.

+

Various notes related to embedded fonts:

+ +

Substitution

+

When a section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.

+ +

For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.

+

+ + + + + + + + + + + + +

+

Font Selection Strategies

+

There are two font selection strategies: character-by-character or auto. The default is auto.

+

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

+ +

Character-by-Character is NOT yet supported!

+

Font List Command-Line Tool

+

FOP contains a small command-line tool that lets you generate a list of all configured fonts. Its class name is: org.apache.fop.tools.fontlist.FontListMain . Run it with the "-?" parameter to get help for the various options.

+
+ + + + 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 @@ + + + + Apache™ FOP: Graphics Formats + + + + + + + + + + + + + + + + + + + +
+ The Apache XML Graphics Project +

Apache™ FOP: Graphics Formats

+
+

Home » Fop » 1.0

+ +

$Revision: 1298724 $

+

Introduction

+

Some noteworthy features of the image handling subsystem are:

+ +

The actual image loading framework does not reside in Apache FOP, but in XML Graphics Commons .

+

Overview of Graphics Support

+

The table below summarizes the theoretical support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats should 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FormatTypeSupport Through
Apache FOP (native)Apache BatikImage I/O
----------------------------------------------
BMP (Microsoft Windows Bitmap)bitmap
EMF (Windows Enhanced Metafile)vector (with embedded bitmaps)(X)
EPS (Encapsulated PostScript)metafile (both bitmap and vector), most frequently used for vector drawings(X)
GIF (Graphics Interchange Format)bitmap
JPEG (Joint Photographic Experts Group)bitmap(X)
PNG (Portable Network Graphic)bitmap
SVG (Scalable Vector Graphics)vector (with embedded bitmaps)
TIFF (Tag Image Format File)bitmap(X)
WMF (Windows Metafile)vector (with embedded bitmaps)
+

Legend:

+ +

Map of supported image formats by output format

+

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:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Image FormatPDFPostScriptJava2D, PNG, TIFF, AWTPCLAFPRTF
BMP (Microsoft Windows Bitmap)XXXXXX
EMF (Windows Enhanced Metafile)X [1]
EPS (Encapsulated PostScript)X [1]
GIF (Graphics Interchange Format)XXXXXX
JPEG (Joint Photographic Experts Group)X [1]X [1]XXX [1]X
PNG (Portable Network Graphic)XXXXXX
SVG (Scalable Vector Graphics)XXXXXX
TIFF (Tag Image Format File)X [2]X [2]XXX [2]X
WMF (Windows Metafile)XXXXXX
+

Legend:

+ +

Graphics Packages

+

XML Graphics Commons Native

+

XML Graphics Commons 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.

+

FOP Native

+

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 Apache Batik .

+

Apache Batik

+

Apache Batik will later receive the SVG and WMF plug-ins for the image loading framework that are currently hosted inside FOP.

+

Current FOP distributions include a distribution of the Apache Batik . Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP. +Batik must be run in a graphical environment. +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.

+

Here are some workarounds:

+ +

Image I/O

+

The image loading framework in XML Graphics Commons provides a wrapper to load images through the JDK's Image I/O API (JSR 015). Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the JAI Image I/O Tools available from Sun.

+

Details on image formats

+

BMP

+

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.

+

EMF

+

Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are embedded without decoding.

+

EPS

+

Apache FOP allows to use EPS files when generating PostScript output only.

+

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.

+

GIF

+

GIF images are supported through an Image I/O codec. Transparency is supported but not guaranteed to work with every output format.

+

JPEG

+

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 I/O codecs concerning images in the CMYK color space. Work-arounds are in place but may not always work as expected.

+

PNG

+

PNG images are supported through an Image I/O codec. Transparency is supported but not guaranteed to work with every output format.

+

SVG

+

Introduction

+

FOP uses Apache Batik for SVG support. This format can be handled as an fo:instream-foreign-object or in a separate file referenced with fo:external-graphic . +Batik's SVG Rasterizer utility may also be used to convert standalone SVG documents into PDF. For more information please see the SVG Rasterizer documentation on the Batik site.

+

Placing SVG Graphics into PDF

+

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.

+

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

+

Currently transparency is limited in PDF so some SVG images that contain effects or graphics with transparent areas may not be displayed correctly.

+

Placing SVG Text into PDF and PostScript

+

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 text.svg / text.pdf / text.png 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.

+

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.

+

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.

+

Font selection notes

+

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.

+

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.

+

Scaling

+

Currently, SVG images are rendered with the dimensions specified in the SVG file , 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.

+

If you use pixels to specify the size of an SVG graphic the "source resolution" setting in the configuration 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.

+

Known Problems

+ +

TIFF

+

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 I/O codec is necessary for decoding the image.

+

There may be some limitation concerning images in the CMYK color space.

+

WMF

+

Windows Metafiles (WMF) are supported through classes in Apache Batik . At the moment, support for this format is experimental and may not always work as expected.

+

Graphics Resolution

+

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

+

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.

+

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 configuration if SVG filters are applied. This can be used as a work-around to resample images in FO documents.

+

Page selection for multi-page formats

+

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: #page= (for example: http://localhost/images/myimage.tiff#page=3 )

+

Image caching

+

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.

+

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.

+

If all else fails, the image cache can be cleared like this: fopFactory.getImageManager().getCache().clearCache();

+
+ + + + 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 @@ + + + + Apache™ FOP: Hyphenation + + + + + + + + + + + + + + + + + + + +
+ The Apache XML Graphics Project +

Apache™ FOP: Hyphenation

+
+

Home » Fop » 1.0

+ +

$Revision: 1298724 $

+

Hyphenation Support

+

Introduction

+

Apache™ FOP uses Liang's hyphenation algorithm, well known from TeX. It needs language specific pattern and other data for operation.

+

Because of licensing issues (and for convenience), all hyphenation patterns for FOP are made available through the Objects For Formatting Objects 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 FOP User mailing list .

+

License Issues

+

Many of the hyphenation files distributed with TeX and its offspring are licenced under the LaTeX Project Public License (LPPL) , 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.

+

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. +The user is responsible to settle license issues for hyphenation pattern files that are obtained from non-Apache sources.

+

Sources of Custom Hyphenation Pattern Files

+

The most important source of hyphenation pattern files is the CTAN TeX Archive .

+

Installing Custom Hyphenation Patterns

+

To install a custom hyphenation pattern for use with FOP:

+
    +
  1. +

    Convert the TeX hyphenation pattern file to the FOP format. The FOP format is an xml file conforming to the DTD found at {fop-dir}/hyph/hyphenation.dtd .

    +
  2. +
  3. +

    Name this new file following this schema: languageCode_countryCode.xml . The country code is optional, and should be used only if needed. For example:

    +
  4. +
  5. +

    en_US.xml would be the file name for American English hyphenation patterns.

    +
  6. +
  7. +

    it.xml would be the file name for Italian hyphenation patterns. +The language and country codes must match the XSL-FO input, which follows ISO 639 (languages) and ISO 3166 (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)

    +
  8. +
  9. +

    There are basically three ways to make the FOP-compatible hyphenation pattern file(s) accessible to FOP:

    +
  10. +
  11. +

    Download the precompiled JAR from OFFO and place it either in the {fop-dir}/lib directory, or in a directory of your choice (and append the full path to the JAR to the environment variable FOP_HYPHENATION_PATH ).

    +
  12. +
  13. +

    Download the desired FOP-compatible hyphenation pattern file(s) from OFFO , and/or take your self created hyphenation pattern file(s),

    +
      +
    • +

      place them in the directory {fop-dir}/hyph ,

      +
    • +
    • +

      or place them in a directory of your choice and set the Ant variable user.hyph.dir to point to that directory (in build-local.properties ), +and run Ant with build target jar-hyphenation . This will create a JAR containing the compiled patterns in {fop-dir}/build 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 user.hyph.dir variable, this JAR will automatically be created from the supplied pattern(s)).

      +
    • +
    +
  14. +
  15. +

    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 configuration option.

    +
  16. +
+

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 configuration option programmatically (option 3).

+

Hyphenation Patterns

+

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 OFFO's Hyphenation page for examples. Here is a brief explanation of the contents of FOP's hyphenation patterns: +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 FOP User mailing list , either confirming their accuracy, or raising specific problems that we can address.

+ +

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.

+

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.

+

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 The TeX Book , 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.

+
+ + + + 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 @@ + + + + Apache™ FOP Version 1.0 + + + + + + + + + + + + + + + + + + + +
+ The Apache XML Graphics Project +

Apache™ FOP Version 1.0

+
+

Home » Fop » 1.0

+ +

$Revision: 1298724 $

+

Introduction

+

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.

+

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.

+

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 Changes Page and the Release Notes .

+

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 compliance page .

+

Upgrading from an earlier version

+

If you're upgrading to this version from an earlier version of FOP, please read the information contained on the Upgrading page !

+

Download

+

To download this version, please visit the download page .

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