From 1c8e1914be9922a0327bf6f7cb177c80c981c14d Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Mon, 28 Jul 2003 17:40:47 +0000 Subject: [PATCH] 1. add detail of command-line options for PFMReader and TTFReader 2. add more detail about the encoding issues for TTF metrics git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196752 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/fonts.xml | 70 ++++++++++++++++++++--- 1 file changed, 62 insertions(+), 8 deletions(-) diff --git a/src/documentation/content/xdocs/fonts.xml b/src/documentation/content/xdocs/fonts.xml index f2ec00952..7529a9ae2 100644 --- a/src/documentation/content/xdocs/fonts.xml +++ b/src/documentation/content/xdocs/fonts.xml @@ -117,12 +117,20 @@ 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; lib\xercesImpl.jar;lib\xalan.jar - org.apache.fop.fonts.apps.PFMReader pfm-file xml-file + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file

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. + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file +

PFMReader [options]:

+ + 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. 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. @@ -138,8 +146,53 @@ Use it in a similar manner to PFMReader. For example, to create such a metcis 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 + 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.
Character Encoding in the Output Document.Correct.Never correct. Search, index, and cut-and-paste operations in the output document +will produce incorrect results.
Character DisplayCorrect.Correct if and only if the font is embedded in the output. (This is possible +because, although the underlying characters are encoded incorrectly, the embedded font is +also encoded incorreclty).
+ As shown in the above table, regardless of +whether the font is embedded or not, text generated from a CID-keyed font metrics file +will never be encoded properly. +Further, if the related font is not embedded, it cannot even be displayed properly. +Obviously, this behavior is not desirable, and we hope to correct it in upcoming releases.
TrueType Collections Font Metrics @@ -175,16 +228,17 @@ Relative URLs are resolved relative to the fontBaseDir property (or baseDir) if 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. +

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.

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

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

One workaround for this behavior is to use the "-enc 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.

+Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets. +See Table of TTF Encoding Options for more details.

-- 2.39.5