From: William Victor Mote Date: Wed, 9 Jul 2003 19:41:15 +0000 (+0000) Subject: pretty-print changes only. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1307 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fd95f885027358cb248b7eb9f21f0a90e18b19fd;p=xmlgraphics-fop.git pretty-print changes only. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196670 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/fonts.xml b/src/documentation/content/xdocs/fonts.xml index 78304d80a..ec055f2cb 100644 --- a/src/documentation/content/xdocs/fonts.xml +++ b/src/documentation/content/xdocs/fonts.xml @@ -1,212 +1,194 @@ -
FOP: Fonts - +
- -
- Summary -

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RendererBase-14AWT/OSCustomEmbedding
PDFyesnoyesyes
PostScriptyesnoyesno
PCLyes (modified)nonono
TXTyes (used for layout but not for output)noyes (used for layout but not for output)no
AWTif available from OSyesnon/a (display only)
Printif available from OSyesnocontrolled by OS printer driver
RTFn/a (font metrics not needed)n/an/an/a
MIFn/a (font metrics not needed)n/an/an/a
SVGif available from OSyesnono
XMLyesnoyesn/a
-
-
- Base-14 Fonts -

The Adobe PDF Specification specifies a set of 14 fonts that must be available to every PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.

-
-
- AWT/Operating System Fonts -

The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.

-
-
- Custom Fonts -

Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added. - More information about font types can be found at - the - Adobe font types. There is also lots more font information - on this Adobe Font Technote. -

-
- Create Type 1 Font Metrics -

FOP includes a tool that can generate an appropriate font metrics file from the PFM file that normally comes with the Type 1 font file. + +

+ Summary +

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RendererBase-14AWT/OSCustomEmbedding
PDFyesnoyesyes
PostScriptyesnoyesno
PCLyes (modified)nonono
TXTyes (used for layout but not for output)noyes (used for layout but not for output)no
AWTif available from OSyesnon/a (display only)
Printif available from OSyesnocontrolled by OS printer driver
RTFn/a (font metrics not needed)n/an/an/a
MIFn/a (font metrics not needed)n/an/an/a
SVGif available from OSyesnono
XMLyesnoyesn/a
+
+
+ Base-14 Fonts +

The Adobe PDF Specification specifies a set of 14 fonts that must be available to every PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.

+
+
+ AWT/Operating System Fonts +

The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.

+
+
+ Custom Fonts +

Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added. +More information about font types can be found at the Adobe font types. +There is also lots more font information on this Adobe Font Technote.

+
+ Create Type 1 Font Metrics +

FOP includes a tool that can generate an appropriate font metrics file from the PFM file that normally comes with the Type 1 font file. To use it, run the class org.apache.fop.fonts.apps.PFMReader:

-

Windows:

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; +

Windows:

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.PFMReader pfm-file xml-file -

Unix:

- java -cp build/fop.jar:lib/avalon-framework.jar:lib/xml-apis.jar: +

Unix:

+ java -cp build/fop.jar:lib/avalon-framework.jar:lib/xml-apis.jar: lib/xercesImpl.jar:lib/xalan.jar org.apache.fop.fonts.apps.PFMReader pfm-file xml-file - The classpath in the above example has been simplified for readibity. + The classpath in the above example has been simplified for readibity. You will have to adjust the classpath to the names of the actual JAR files in the lib directory. avalon-framework.jar is necessary only for versions 0.20.5 or later. xml-apis.jar, xercesImpl.jar and xalan.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. + 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. -
-
- Register Type 1 Font Metrics with FOP -

Edit conf/userconfig.xml and add entries for the font in the fonts section, e.g.:

- +
+ Register Type 1 Font Metrics with FOP +

Edit conf/userconfig.xml and add entries for the font in the fonts section, e.g.:

+ ]]> - Starting with FOP version 0.20.5 you can use URLs for the paths to the font files. + Starting with FOP version 0.20.5 you can use URLs for the paths to the font files. Relative URLs are resolved relative to the fontBaseDir property (or baseDir) if available. - Make sure you specify the PFB file in the embed-file attribute and not the PFM you used to generate the XML font metrics file. - If you do not want the font embedded in the PDF then remove the "embed-file" attribute. + Make sure you specify the PFB file in the embed-file attribute and not the PFM you used to generate the XML font metrics file. + If you do not want the font embedded in the PDF then remove the "embed-file" attribute. The PDF will then contain text using the font with the font metrics and to view it properly the font will need to be installed where it is being viewed. - Cocoon users will need to setup the config, see FOPSerializer for more information. -
- -
- Creating TrueType Font Metrics -

FOP includes a tool that can generate an appropriate font metrics file from your TrueType font file. To create such a file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; + Cocoon users will need to setup the config, see FOPSerializer for more information. +
+
+ Creating TrueType Font Metrics +

FOP includes a tool that can generate an appropriate font metrics file from your TrueType font file. To create such a file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader C:\myfonts\cmr10.ttf ttfcm.xml -
-
- Creating TrueType Collections Font Metrics -

TrueType collections (.ttc files) contains more than one font. +

+
+ Creating TrueType Collections Font Metrics +

TrueType collections (.ttc files) contains 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). +

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.

-

Example on generating metrics for a .ttc file:

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; +

Example on generating metrics for a .ttc file:

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar; lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" msmincho.ttc msminch.xml -
+
Register the fonts within FOP

Similiar to Type 1 fonts.

- ]]>
-
-
- Embedding fonts - The PostScript renderer does not yet support font embedding. - 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-file attribute. - If you don't specify the embed-file attribute the font will not be embedded, but will only be referenced. -

-

- When FOP embeds a font, it scrambles its fontname by inserting a prefix that ensures that the fontname 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. -

-

- When embedding PostScript fonts, the entire font is always embedded. -

-

- When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a new font, containing only the glyphs used, is created from the original font and embedded in the pdf. +

+
+ Embedding fonts + The PostScript renderer does not yet support font embedding. + 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-file attribute. +If you don't specify the embed-file attribute the font will not be embedded, but will only be referenced.

+

When FOP embeds a font, it scrambles its fontname by inserting a prefix that ensures that the fontname 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.

+

When embedding PostScript fonts, the entire font is always embedded.

+

When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a new font, containing only the glyphs used, is created from the original font and embedded in the pdf. Currently, this embedded font contains only the minimum data needed to be embedded in a pdf document, and does not contain any codepage information. The PDF document contains indexes to the glyphs in the font instead of to encoded characters. -While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly. -

-

- One workaround for this behavior is to use the -ansi option when generating metrics with TTFReader. +While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly.

+

One workaround for this behavior is to use the -ansi option when generating metrics with TTFReader. This will cause the whole font to be embedded in the pdf document. -Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets. -

-
- - Be sure to start FOP with the option to find the config file ("-c conf/userconfig.xml" from the command line). Otherwise, it has no way of finding your custom font information. - - +Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets.

+
+ Be sure to start FOP with the option to find the config file ("-c conf/userconfig.xml" from the command line). Otherwise, it has no way of finding your custom font information. + -