From 7d9ddd5cddc8bc0efd5b571f92fddb10a4e6257a Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Sun, 13 Apr 2003 17:29:45 +0000 Subject: [PATCH] Add Tore Envig's comments re: embedding fonts, from a 2002-11-26 fop-dev message: http://nagoya.apache.org/eyebrowse/ReadMsg?listName=fop-dev@xml.apache.org&msgNo=3377 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196250 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/fonts.xml | 32 ++++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/documentation/content/xdocs/fonts.xml b/src/documentation/content/xdocs/fonts.xml index ac9559d65..938a88582 100644 --- a/src/documentation/content/xdocs/fonts.xml +++ b/src/documentation/content/xdocs/fonts.xml @@ -37,7 +37,7 @@
- Adding additional Type 1 fonts + Adding Type 1 fonts

As mentioned above you need an XML file containing font metrics to be able to use an additional font. FOP contains a tool that can generate such a font metrics file from a PFM file, which normally comes with the font file.

@@ -102,7 +102,7 @@ java -cp build/fop.jar:lib/avalon-framework.jar:lib/xml-apis.jar:
- Adding additional TrueType + Adding TrueType Fonts

Adding TrueType fonts is almost identical to the process of adding Type 1 fonts. The main difference is in the first step.

@@ -165,13 +165,31 @@ java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;
Embedding fonts

- Font embedding is enabled in the userconfig.xml file and controlled over the embed-file attribute. - If you don't specify the embed-file attribute the fonts doesn't get embedded but only referenced. + 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, 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. +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.

- - Remember to start fop with -c conf/userconfig.xml on the command line. -
+ + 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. + -- 2.39.5