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 "Partridge, Michael" <Mi...@shps.net> on 2004/11/01 22:05:43 UTC

RE: problem converting TTF using TTFReader

Thank you for your reply; unfortunately I got the same output when giving TTFReader the '-enc ansi' option.

<mp...@zond>$ java -cp ~/src/fop-0.20.5/build/fop.jar:~/src/fop-0.20.5/lib/avalon-framework-cvs-20020806.jar:~/src/fop-0.20.5/lib/xercesImpl-2.2.1.jar:~/src/fop-0.20.5/lib/xalan-2.4.1.jar org.apache.fop.fonts.apps.TTFReader -enc ansi ~/fonts/OCR/OCR-A.TTF ~/fonts/OCR/OCR.xml
TTF Reader v1.1.1

Reading /home/mpartridge/fonts/OCR/OCR-A.TTF...

Number of glyphs in font: 115
Unicode cmap table not present
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:507)
        at java.util.ArrayList.get(ArrayList.java:324)
        at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:449)
        at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:439)
        at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:222)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:184)

I've been searching for ways to generate a Unicode cmap table and I've found tools to translate cmap tables but nothing to create one in an existing font. If anyone knows of an app that can do this, please let me know.

Mike Partridge



-----Original Message-----
From:	J.Pietschmann [mailto:j3322ptm@yahoo.de]
Sent:	Sat 10/30/2004 12:03 PM
To:	fop-user@xml.apache.org
Cc:	
Subject:	Re: problem converting TTF using TTFReader
Partridge, Michael wrote:
> I get the following output when attempting to generate a font metrics file from an OCR true type font:
...
> Unicode cmap table not present
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>         at java.util.ArrayList.RangeCheck(ArrayList.java:507)
>         at java.util.ArrayList.get(ArrayList.java:324)
>         at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:449)
...
> Is this a problem with the font file itself? 

Yes. It is common for OCR and barcode fonts to omit the
cmap, for whatever reason.
Try the telliung TTFReader to use winansi encoding, assuming
the character range in the font fits the encodable range.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org





RE: problem converting TTF using TTFReader

Posted by Victor Mote <vi...@outfitr.com>.
Partridge, Michael wrote:

> Thank you for your reply; unfortunately I got the same output 
> when giving TTFReader the '-enc ansi' option.
> 
> <mp...@zond>$ java -cp 
> ~/src/fop-0.20.5/build/fop.jar:~/src/fop-0.20.5/lib/avalon-fra
> mework-cvs-20020806.jar:~/src/fop-0.20.5/lib/xercesImpl-2.2.1.
> jar:~/src/fop-0.20.5/lib/xalan-2.4.1.jar 
> org.apache.fop.fonts.apps.TTFReader -enc ansi 
> ~/fonts/OCR/OCR-A.TTF ~/fonts/OCR/OCR.xml TTF Reader v1.1.1
> 
> Reading /home/mpartridge/fonts/OCR/OCR-A.TTF...
> 
> Number of glyphs in font: 115
> Unicode cmap table not present
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>         at java.util.ArrayList.RangeCheck(ArrayList.java:507)
>         at java.util.ArrayList.get(ArrayList.java:324)
>         at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:449)
>         at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:439)
>         at 
> org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:222)
>         at 
> org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:184)
> 
> I've been searching for ways to generate a Unicode cmap table 
> and I've found tools to translate cmap tables but nothing to 
> create one in an existing font. If anyone knows of an app 
> that can do this, please let me know.

The tools that I use are FontLab (commercial):
http://www.fontlab.com/html/fontlab.html

and TTX (open source):
http://sourceforge.net/projects/fonttools/

You can do almost anything with TTX, but it requires some knowledge of the
font file formats. FontLab is going to be pricey if this is all you need it
for. Support for other encodings could be added to tools like FOP, but that
is likely to be even pricier. Best solution that I can think of is probably
to just purchase a different font (or hire someone to fix the existing one
-- but watch out for licensing issues).

Victor Mote


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org