You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Richard Bondi <rb...@ergito.com> on 2002/07/02 20:05:29 UTC
TTF font support problem with Verdana and others
Dear All,
I've followed the fop documentation's instructions
(http://xml.apache.org/fop/fonts.html) for embedding fonts (see below for
what I did) in both fop 2.03 and 2.04rc, to embed Verdana; yet I keep
getting the error "unknown font Verdana,normal,normal so defaulted font to
any". This happens whether I send the file to awt or to a pdf.
Here's what I did for 2.03:
- fop 2.03 is in c:\java\fop203
- Verdana.ttf is in c:\winnt\fonts\verdana.ttf
- Generated the xml file:
c:\jdk1.4\bin\java -cp
build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar
org.apache.fop.fonts.apps.TTFReader C:\winnt\fonts\verdana.ttf ttfverdana.xml
- Moved the ttfverdana.xml to the same directory as fop.jar (this is
actually not in the documentation, but google search suggests this is the
right thing to do; I've also tried putting it in same directory as
userfconfig.xml, to no avail)
- Edited c:\java\fop203\conf\userconfig.xml:
<fonts>
<font metrics-file="c:\java\fop203\build\ttfverdana.xml" kerning="yes"
embed-file="C:\WINNT\Fonts\verdana.ttf">
<font-triplet name="verdana" style="normal" weight="normal">
</font>
</fonts>
(Note: I've also tried using "/" instead of "\" on the off-chance this was
confusing Java, but this made no difference.)
- changed one of the font-family="sans-serif" to font-family="Verdana" in
c:\java\fop203\docs\examples\fo\simple.fo
- ran fop.bat on simple.fo:
cd c:\java\fop203
fop -d -fo docs/examples/fo/simple.fo -awt
The debugging reports the "unknown font Verdana,normal,normal so defaulted
font to any" error.
I've also tried this with the "Century Gothic" font, with the same result;
ditto if I use 2.04rc.
Can anyone advise please?
Many thanks in advance,
Richard Bondi
PS I've attached the ttfverdana.xml file from 2.03, as well as my
userconfig.xml.
Re: TTF font support problem with Verdana and others
Posted by Richard Bondi <rb...@ergito.com>.
At 09:24 PM 7/2/2002 +0200, you wrote:
>By default fop doesn't use any user config, even userconfig.xml in conf
>directory, you have explicitly set it in command line:
>
>fop -d -fo docs/examples/fo/simple.fo -awt -c conf/userconfig.xml
>
>And metrics-file is a URI indeed, try
>metrics-file="file:///c:/java/fop203/build/ttfverdana.xml"
OK, I tried that. The debugger reveals that it is now reading in the
userconfig.xml, but I'm still getting the same error. I tried a URI for the
embed-file as well, just for good measure. I also tried c| instead of c: in
both URIs.
Well, definitely advancing here, but still not at the goal!
Thanks much,
r:b:
PS
Here's the output:
C:\java\fop203>c:\jdk1.4\bin\java -cp
build\fop.jar;lib\batik.jar;lib\xalan-2.0.
0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\j
imi-1.0.jar org.apache.fop.apps.Fop -d -fo docs/examples/fo/simple.fo -awt
-c co
nf/userconfig.xml -x
[DEBUG]: Input mode:
[DEBUG]: FO
[DEBUG]: fo input file: docs\examples\fo\simple.fo
[DEBUG]: Output mode:
[DEBUG]: awt on screen
[DEBUG]: OPTIONS
[DEBUG]: user configuration file: conf\userconfig.xml
[DEBUG]: debug mode on
[DEBUG]: dump configuration
[DEBUG]: quiet mode on
[DEBUG]: reading user configuration file
Dumping configuration:
[DEBUG]: ----------------------
[DEBUG]: key: dumpConfiguration
[DEBUG]: value: true
[DEBUG]: key: fonts
[DEBUG]: values:
[DEBUG]: org.apache.fop.configuration.FontInfo@632c2d -
[DEBUG]:
[DEBUG]: key: version
[DEBUG]: value: FOP 0.20.3
[DEBUG]: key: quiet
[DEBUG]: value: false
[DEBUG]: key: debugMode
[DEBUG]: ----------------------
[DEBUG]: key: stream-filter-list
[DEBUG]: values:
[DEBUG]: flate -
[DEBUG]: ascii-85 -
[DEBUG]:
[DEBUG]: ----------------------
Re: TTF font support problem with Verdana and others
Posted by Richard Bondi <rb...@ergito.com>.
At 09:24 PM 7/2/2002 +0200, you wrote:
>By default fop doesn't use any user config, even userconfig.xml in conf
>directory, you have explicitly set it in command line:
>
>fop -d -fo docs/examples/fo/simple.fo -awt -c conf/userconfig.xml
>
>And metrics-file is a URI indeed, try
>metrics-file="file:///c:/java/fop203/build/ttfverdana.xml"
Also, here's the output without -x option:
C:\java\fop203>fop -d -fo docs/examples/fo/simple.fo -awt -c
conf/userconfig.xml
C:\java\fop203>c:\jdk1.4\bin\java -cp
build\fop.jar;lib\batik.jar;lib\xalan-2.0.
0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\j
imi-1.0.jar org.apache.fop.apps.Fop -d -fo docs/examples/fo/simple.fo -awt
-c co
nf/userconfig.xml
[DEBUG]: Input mode:
[DEBUG]: FO
[DEBUG]: fo input file: docs\examples\fo\simple.fo
[DEBUG]: Output mode:
[DEBUG]: awt on screen
[DEBUG]: OPTIONS
[DEBUG]: user configuration file: conf\userconfig.xml
[DEBUG]: debug mode on
[DEBUG]: dump configuration
[DEBUG]: quiet mode on
[DEBUG]: reading user configuration file
[DEBUG]: base directory: file:/C:/java/fop203/docs/examples/fo/
[DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser
[INFO]: building formatting object tree
[DEBUG]: setting up fonts
[INFO]: [1]
[ERROR]: unknown font Verdana,normal,normal so defaulted font to any
[ERROR]: unknown font Verdana,normal,normal so defaulted font to any
[DEBUG]: Last page-sequence produced 1 pages.
[INFO]: Parsing of document complete, stopping renderer
[DEBUG]: Initial heap size: 1212Kb
[DEBUG]: Current heap size: 3280Kb
[DEBUG]: Total memory used: 2068Kb
[DEBUG]: Memory use is indicative; no GC was performed
[DEBUG]: These figures should not be used comparatively
[DEBUG]: Total time used: 735ms
[DEBUG]: Pages rendererd: 1
[DEBUG]: Avg render time: 735ms/page
Re: TTF font support problem with Verdana and others
Posted by Oleg Tkachenko <ol...@multiconn.com>.
By default fop doesn't use any user config, even userconfig.xml in conf
directory, you have explicitly set it in command line:
fop -d -fo docs/examples/fo/simple.fo -awt -c conf/userconfig.xml
And metrics-file is a URI indeed, try
metrics-file="file:///c:/java/fop203/build/ttfverdana.xml"
Richard Bondi wrote:
> Dear All,
>
> I've followed the fop documentation's instructions
> (http://xml.apache.org/fop/fonts.html) for embedding fonts (see below
> for what I did) in both fop 2.03 and 2.04rc, to embed Verdana; yet I
> keep getting the error "unknown font Verdana,normal,normal so defaulted
> font to any". This happens whether I send the file to awt or to a pdf.
>
> Here's what I did for 2.03:
>
> - fop 2.03 is in c:\java\fop203
> - Verdana.ttf is in c:\winnt\fonts\verdana.ttf
>
> - Generated the xml file:
> c:\jdk1.4\bin\java -cp
> build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar
> org.apache.fop.fonts.apps.TTFReader C:\winnt\fonts\verdana.ttf
> ttfverdana.xml
>
> - Moved the ttfverdana.xml to the same directory as fop.jar (this is
> actually not in the documentation, but google search suggests this is
> the right thing to do; I've also tried putting it in same directory as
> userfconfig.xml, to no avail)
>
> - Edited c:\java\fop203\conf\userconfig.xml:
> <fonts>
> <font metrics-file="c:\java\fop203\build\ttfverdana.xml"
> kerning="yes" embed-file="C:\WINNT\Fonts\verdana.ttf">
> <font-triplet name="verdana" style="normal" weight="normal">
> </font>
> </fonts>
>
> (Note: I've also tried using "/" instead of "\" on the off-chance this
> was confusing Java, but this made no difference.)
>
> - changed one of the font-family="sans-serif" to font-family="Verdana"
> in c:\java\fop203\docs\examples\fo\simple.fo
>
> - ran fop.bat on simple.fo:
> cd c:\java\fop203
> fop -d -fo docs/examples/fo/simple.fo -awt
>
> The debugging reports the "unknown font Verdana,normal,normal so
> defaulted font to any" error.
>
> I've also tried this with the "Century Gothic" font, with the same
> result; ditto if I use 2.04rc.
>
> Can anyone advise please?
>
> Many thanks in advance,
> Richard Bondi
>
> PS I've attached the ttfverdana.xml file from 2.03, as well as my
> userconfig.xml.
--
Oleg Tkachenko
Multiconn International, Israel
Re: TTF font support problem with Verdana and others
Posted by Richard Bondi <rb...@ergito.com>.
That solved a lot -- but still no cigar. On the one hand, fop.bat no makes
no complaints now, and the output to awt looks kind of ok -- it is hard to
tell if it is displaying verdana or not. embed-file was also case
sensitive. However, if I output to a pdf file and open with Acrobat 5, I
get the error message "Unable to find or create the font 1Ea4bcVerdana."
Dots appear in the document instead of text.
There was something else weird too: embed-file didn't want a URI, but
metrics-file did. If I put "file:///C:\WINNT\Fonts\verdana.ttf", fop.bat
couldn't find the file. Here's the excerpt from the userconfig.xml that
finally worked:
<fonts>
<font metrics-file="file:///c:/java/fop203/build/ttfverdana.xml"
kerning="yes" embed-file="C:\WINNT\Fonts\verdana.ttf">
<font-triplet name="Verdana" style="normal" weight="normal"/>
</font>
Here's the fop.bat output to awt, no devoid of error messages.
C:\java\fop203>c:\jdk1.4\bin\java -cp
build\fop.jar;lib\batik.jar;lib\xalan-2.0.
0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\j
imi-1.0.jar org.apache.fop.apps.Fop -d -fo docs/examples/fo/simple.fo -awt
-c co
nf/userconfig.xml
[DEBUG]: Input mode:
[DEBUG]: FO
[DEBUG]: fo input file: docs\examples\fo\simple.fo
[DEBUG]: Output mode:
[DEBUG]: awt on screen
[DEBUG]: OPTIONS
[DEBUG]: user configuration file: conf\userconfig.xml
[DEBUG]: debug mode on
[DEBUG]: dump configuration
[DEBUG]: quiet mode on
[DEBUG]: reading user configuration file
[DEBUG]: base directory: file:/C:/java/fop203/docs/examples/fo/
[DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser
[INFO]: building formatting object tree
[DEBUG]: setting up fonts
[INFO]: [1]
[DEBUG]: create embedFont C:\WINNT\Fonts\verdana.ttf
[DEBUG]: Last page-sequence produced 1 pages.
[INFO]: Parsing of document complete, stopping renderer
[DEBUG]: Initial heap size: 1204Kb
[DEBUG]: Current heap size: 3299Kb
[DEBUG]: Total memory used: 2095Kb
[DEBUG]: Memory use is indicative; no GC was performed
[DEBUG]: These figures should not be used comparatively
[DEBUG]: Total time used: 3015ms
[DEBUG]: Pages rendererd: 1
[DEBUG]: Avg render time: 3015ms/page
Looking forward to further ideas!
Many thanks for all help so far,
Richard Bondi
At 10:19 PM 7/2/2002 +0200, you wrote:
>Richard Bondi wrote:
>> <font-triplet name="verdana"
> ^^^
>>The debugging reports the "unknown font Verdana,no
> ^^^
>
>Try
> <font-triplet name="Verdana" ...
>
>J.Pietschmann
>
>
>
Re: TTF font support problem with Verdana and others
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Richard Bondi wrote:
> <font-triplet name="verdana"
^^^
> The debugging reports the "unknown font Verdana,no
^^^
Try
<font-triplet name="Verdana" ...
J.Pietschmann