From: Keiron Liddle Date: Thu, 12 Dec 2002 10:59:33 +0000 (+0000) Subject: some font faq clarifications X-Git-Tag: Alt-Design-integration-base~246 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8aefb9ce85d253e16ce71e441409bab000902cec;p=xmlgraphics-fop.git some font faq clarifications removed or fixed empty links added wiki link git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195769 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/dev/book.xml b/src/documentation/content/xdocs/dev/book.xml index 74e016c4d..2bcb04277 100644 --- a/src/documentation/content/xdocs/dev/book.xml +++ b/src/documentation/content/xdocs/dev/book.xml @@ -24,6 +24,7 @@ + diff --git a/src/documentation/content/xdocs/dev/faq.xml b/src/documentation/content/xdocs/dev/faq.xml index 3a1c56f24..800174f74 100644 --- a/src/documentation/content/xdocs/dev/faq.xml +++ b/src/documentation/content/xdocs/dev/faq.xml @@ -274,12 +274,12 @@ path/file.ext or ../file.ext. The string file:path/file.ext is not a relative URL, in fact, it isn't a valid URL at all. A relative URL is subject to a - resolving process, which transforms it into an absolute + resolving process, which transforms it into an absolute URL.

- See Understanding URIs and URLs and Understanding - URL resolving. + See Understanding URIs and URLs and Understanding + URL resolving.

@@ -298,7 +298,7 @@ whether you got them right.

- You can use the FOP DTD or FOP Schema to + You can use the FOP DTD or FOP Schema to validate your soure. This will catch most, but still not all problems.

@@ -368,8 +368,8 @@ the user agent.

- See Understanding URIs and URLs and Understanding - URL resolving. + See Understanding URIs and URLs and Understanding + URL resolving.

@@ -506,7 +506,7 @@

- See also supported image formats. + See also supported image formats.

@@ -526,7 +526,7 @@ How do I use FOP in a servlet? -

Look at the servlet example.

+

Look at the servlet example.

A rather minimal code snippet to demonstrate the basics:

@@ -541,7 +541,7 @@ driver.run(); with IEx and view it later. There are other problems with this code.

- Please look into Howto embed FOP in a servlet for all + Please look into Howto embed FOP in a servlet for all kinds of details.

@@ -802,26 +802,30 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));How do I embed fonts in PDF?

- Provide$$$ + See the Fonts page for information + about embedding fonts.

- Characters not displayed, or displayed incorrectly, or displayed - as "#" + Characters not displayed, or displayed incorrectly, or displayed as "#" -

Answers are that fonts must be available on the target platform, and +

Answers are that fonts must be available for the output format, and the selected font must contain glyphs for the desired character. +PDF has a set of defined fonts, other fonts can be embedded following the +instructions. +To find out if the characters you need are in the core fonts then +(todo - find a glyph font table for the fonts).

For example, for most symbols, the symbol font has to be selected - explicitely (actually: is this a feature or a bug?): + explicitely (in future it should be possible to specify a list of fonts +where it will select the font for the specified character):

<fo:inline font-family="Symbol">&#x2205;</fo:inline>

gives EMPTY SET while the same characters in the default font results in AE LIGATURE (which happens to occupy the same place in the default font as the EMPTY SET in the Symbol font). The "#" shows up if the selected font does not define a glyph for the translated index.

-

(Still applicable in 0.20.3?)

diff --git a/src/documentation/content/xdocs/faq.xml b/src/documentation/content/xdocs/faq.xml index 91e39f505..ef25c3646 100644 --- a/src/documentation/content/xdocs/faq.xml +++ b/src/documentation/content/xdocs/faq.xml @@ -113,8 +113,8 @@ How can I contribute?

- There is always plenty of things to do. See limitations - and bugzilla. + There is always plenty of things to do. See + getting involved.

@@ -139,7 +139,7 @@ master definitions.

- See also release notes. + See also release notes.

@@ -150,14 +150,14 @@ The Jimi image library, which is used for processing images in PNG and other formats, was removed from the distribution for licensing reasons. You have to download - and install it by yourself. + and install it by yourself.

I get a NoClassDefFound exception. -

This is typically a problem with your classpath.

+

This is typically a problem with your classpath.

If you are running FOP from the command line:

  • @@ -207,11 +207,11 @@

    • - Avoid forward references. Forward references cause all + Avoid forward references. Forward references cause all pages from the page with the reference on to be held in memory until the page with the referenced element is encountered. Common forward references are table of contents at the beginning of the document - and the "page N of TOTAL" in footers. Forward + and the "page N of TOTAL" in footers. Forward references may be required by the task, however, if you are getting a memory overflow you should at least check whether this is really as necessary as claimed. A TOC, for example, could often be placed @@ -233,7 +233,7 @@ possibly be freed after the page sequence has been rendered.
    • - Increase memory settings of the JVM. Be aware that it + Increase memory settings of the JVM. Be aware that it is usually unwise to increase the memory allocated to the JVM beyond the amount of physical RAM, it will significantly slow down. YMMV.
    • @@ -248,13 +248,14 @@

      Reducing memory consumption in general and squishing bugs is an - ongoing effort, partially addressed in the redesign. + ongoing effort, partially addressed in the redesign.

      I get a MalformedURLException. +

      What you probably think of as "file names" are usually URLs, in particular the src attribute of fo:external-graphic. @@ -277,12 +278,12 @@ path/file.ext or ../file.ext. The string file:path/file.ext is not a relative URL, in fact, it isn't a valid URL at all. A relative URL is subject to a - resolving process, which transforms it into an absolute + resolving process, which transforms it into an absolute URL.

      - See Understanding URIs and URLs and Understanding - URL resolving. + See Understanding URIs and URLs and Understanding + URL resolving.

      @@ -367,13 +368,13 @@ FO document. This will catch most problems, but should not be relied upon to cat Relative URLs are resolved against the baseDir property of FOP. For the command line FOP application, the baseDir is the directory of the input file, either the FO file or the XML source. If FOP is used - embedded in a servlet, baseDir can be set explicitely. If + embedded in a servlet, baseDir can be set explicitely. If it's not set, it is usually the current working directory of the process which runs FOP.

      - See Understanding URIs and URLs and Understanding - URL resolving. + See Understanding URIs and URLs and Understanding + URL resolving.

      @@ -510,7 +511,7 @@ FO document. This will catch most problems, but should not be relied upon to cat

    - See also supported image formats. + See also supported image formats.

    @@ -530,7 +531,7 @@ FO document. This will catch most problems, but should not be relied upon to cat How do I use FOP in a servlet? -

    Look at the servlet example.

    +

    Look at the servlet example.

    A rather minimal code snippet to demonstrate the basics:

    @@ -545,7 +546,7 @@ driver.run(); with IEx and view it later. There are other problems with this code.

    - Please look into Howto embed FOP in a servlet for all + Please look into Howto embed FOP in a servlet for all kinds of details.

    @@ -822,12 +823,6 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler())); Make sure that the reference is valid in the current SVG document.
  • -
  • - **DOES THIS WORK** - Let the URL refer to some location where the gradient could be - retrieved, for example if the SVG code is embedded in your XSL, - try fill="url(my.xsl#PurpleToWhite)". -

In any case, the referenced stuff has to be pointed to by an URL. It @@ -841,7 +836,7 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler())); -

See also MalformedURLException

+

See also MalformedURLException

@@ -851,7 +846,8 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));How do I embed fonts in PDF?

- Provide$$$ + See the Fonts page for information + about embedding fonts.

@@ -859,18 +855,22 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));Characters not displayed, or displayed incorrectly, or displayed as "#" -

Answers are that fonts must be available on the target platform, and +

Answers are that fonts must be available for the output format, and the selected font must contain glyphs for the desired character. +PDF has a set of defined fonts, other fonts can be embedded following the +instructions. +To find out if the characters you need are in the core fonts then +(todo - find a glyph font table for the fonts).

For example, for most symbols, the symbol font has to be selected - explicitely (actually: is this a feature or a bug?): + explicitely (in future it should be possible to specify a list of fonts +where it will select the font for the specified character):

<fo:inline font-family="Symbol">&#x2205;</fo:inline>

gives EMPTY SET while the same characters in the default font results in AE LIGATURE (which happens to occupy the same place in the default font as the EMPTY SET in the Symbol font). The "#" shows up if the selected font does not define a glyph for the translated index.

-

(Still applicable in 0.20.3?)

@@ -1236,6 +1236,7 @@ transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));(FO) How do I print the total number of pages, like in "page 1 of 12" +

(XSL FAQ)

@@ -1396,7 +1397,7 @@ class rendtest { offending characters.

- Refer to the XML specification or to a good tutorial for + Refer to the XML specification or to a good tutorial for details of the XML file format.

diff --git a/src/documentation/content/xdocs/fo/size.fo b/src/documentation/content/xdocs/fo/size.fo index 0279c69ef..2076276df 100644 --- a/src/documentation/content/xdocs/fo/size.fo +++ b/src/documentation/content/xdocs/fo/size.fo @@ -105,6 +105,11 @@ The image () has uniform scaling. + +The image +() +is scaled to fit the viewport. + diff --git a/src/documentation/content/xdocs/fonts.xml b/src/documentation/content/xdocs/fonts.xml index d76e05aa3..478b08a69 100644 --- a/src/documentation/content/xdocs/fonts.xml +++ b/src/documentation/content/xdocs/fonts.xml @@ -18,6 +18,10 @@

Font support in FOP can be extended by the addition of font metric files (written in XML) created from Adobe Type 1 fonts and TrueType fonts. No other font types (Type 3, etc.) are supported at this time. + 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.

The font is simply embedded into the PDF file, it is not converted. @@ -34,15 +38,15 @@

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 - +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:lib/xercesImpl.jar:lib/xalan.jar org.apache.fop.fonts.apps.PFMReader pfm-file xml-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.PFMReader pfm-file xml-file The classpath in the above example has been simplified for readibity. @@ -60,17 +64,14 @@
Register the fonts within FOP

- Edit conf/userconfig.xml and add entries for the font - if the fonts section, - ie: + Edit conf/userconfig.xml and add entries for the font + if the fonts section, + ie:

- - - - ]]> - - + + +]]> Starting from 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. @@ -109,9 +110,10 @@ the name cmr10.ttf and exists in c:\myfonts\):

- - 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 C:\myfonts\cmr10.ttf ttfcm.xml - +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 C:\myfonts\cmr10.ttf ttfcm.xml
@@ -132,9 +134,10 @@ 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 - +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
@@ -143,13 +146,10 @@

Similiar to Type 1 fonts.

- - - - ]]> - - + + +]]> diff --git a/src/documentation/content/xdocs/output.xml b/src/documentation/content/xdocs/output.xml index fee304c53..4af6ac7c6 100644 --- a/src/documentation/content/xdocs/output.xml +++ b/src/documentation/content/xdocs/output.xml @@ -81,6 +81,18 @@ The PDF version supported is 1.3 which is currently the most popular version for Acrobat Reader (4.0), PDF versions are forwards/backwards compatible.

+ +

+ PDF has a set of fonts that are always available to all PDF viewers, + to quote from the PDF Specification: + +"PDF prescribes a set of 14 standard fonts that can be used without prior +definition. +These include four faces each of three Latin text typefaces (Courier, +Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf +Dingbats). These fonts, or suitable substitute fonts with the same metrics, are +guaranteed to be available in all PDF viewer applications." +

PCL