Bug 11247 - Error encountered in converting ttf file in FOP
Summary: Error encountered in converting ttf file in FOP
Status: CLOSED WORKSFORME
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.4
Hardware: Sun Solaris
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-29 05:32 UTC by Andrew
Modified: 2012-04-01 13:49 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2002-07-29 05:32:28 UTC
Hi,

I use the TTFReader to generate the font file from ttf or ttc to type 1 font 
file used by FOP.  Since I wanna use chinese and unicode, therefore, two font 
files namely arialuni.ttf from Win2K and mingliu.ttc from Chinese WinNT have 
been selected.  Unfortunately, I encouter different error as converting these 
files

arialuni.ttf = OutofMemoery return
mingliu.ttc = java.io.IOException: Failed to read font at 
java.lang.Throwable.fillInStackTrace

can you help me to resolve it.

Another question, according to your instruction, the converted font file should 
be included in conf/userconfig.xml and then use fop.sh (in unix)to generate the 
PDF file.  How about in servlet version, can we instruct the program to read 
this configuration file to include the fonts in PDF file

Thanks
Andrew
Comment 1 J.Pietschmann 2002-08-01 10:08:16 UTC
Problem 1: Arialuni.ttf: I can't reproduce the problem. Check the Memory
 settingsof your JVM
Problem 2: mingliu.ttc: A ttc file is a collection of TrueType fonts, not
 a single font. You have to supply the font to extract with the -ttcname 
 option
Problem 3: Using a userconfig for a embedded FOP: this is a FAQ. Check the
 archives for the fop-user and fop-dev lists, as mentioned in the documentation
 delivered with the FOP binary distribution (docs/html-docs/ressources.html)
Comment 2 Andrew 2002-08-01 10:36:06 UTC
For the problem 2, I use the following command:

java -cp build/fop.jar:lib/xercesImpl-2.0.1.jar:lib/xml-apis.jar:lib/xalan-
2.3.1.jar:lib/batik.jar org.apache.fop.fonts.apps.TTFReader -ttcname "Ming 
Liu" /data/fop/fop-0.20.4/mingliu.ttc mingliu.xml

the result is:

TTF Reader v1.1.1

Reading /data/fop/fop-0.20.4/mingliu.ttc...

This is a TrueType collection file with2 fonts
Containing the following fonts: 
MingLiU
PMingLiU
java.io.IOException: Failed to read font
	  	at java.lang.Throwable.fillInStackTrace(Native Method)
		at java.lang.Throwable.fillInStackTrace(Compiled Code)
		at java.lang.Throwable.<init>(Compiled Code)
		at java.lang.Exception.<init>(Exception.java:42)
		at java.io.IOException.<init>(IOException.java:47)
		at org.apache.fop.fonts.TTFFile.readFont(Unknown Source)
		at org.apache.fop.fonts.apps.TTFReader.loadTTF(Unknown Source)
		at org.apache.fop.fonts.apps.TTFReader.main(Unknown Source)

Comment 3 J.Pietschmann 2002-08-01 12:09:27 UTC
You can't extract fonts which are not in the font collection. Try
 -ttcname "MingLiU"
Comment 4 Andrew 2002-08-02 01:00:25 UTC
one more question,

is it possible to generate the chinese PDF file in version 1.2 which can be 
viewed by arcobat 3.0.

Many thanks
Comment 5 Andrew 2002-08-02 01:12:04 UTC
for more information,

can I use your FOP to generate the PScript and then directly forward to client 
browser for printing.
Comment 6 Glenn Adams 2012-04-01 13:49:22 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs