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 "Archana Visveswaran, ASDC Chennai" <ar...@hcl.in> on 2006/04/05 12:04:16 UTC

Error while creating metric file

Hi, 

 

I am using fop-0.20.5.

I need to create a metric file for Webdings, OCR font and Symbol. But I
get the following error:

 

Reading C:\WINNT\Fonts\Symbol.ttf...

 

Number of glyphs in font: 192

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 saw a similar post but the solution was not provided. 

How can I write the metric file? I am using 1.4.2_03 version of Java.

My aim is to convert an fo file to pdf. This uses Symbol and OCR font.

Is there any way these fonts can be included or do we have any
restrictions while using FOP?

 

 

Thanks and Regards,

Archana V


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
See here: http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#config-external

On 05.04.2006 16:57:51 Archana Visveswaran, ASDC Chennai wrote:
> Right! When I used fop -c option from my command line, the file gets
> converted well.
> 
> But I have a Java application that does this conversion. 
> 
> Executing this code is similar to execution fop from command line. 
> 
> How can I make this code work with the -c option. 
> 
> i.e how do I ensure that the correct config file is referred to?
> 
> I have attached the Java File.
<snip/>


Jeremias Maerki


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


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Are you sure that FOP picks up your userconfig.xml (-c on the
command-line)? If I use your triplet for the OCR font with one of my
fonts, it works fine.

On 05.04.2006 15:55:24 Archana Visveswaran, ASDC Chennai wrote:
> Oops! I have now changed the userconfig file. 
> 
> I still get the same error.
> 
> What is this font-triplet name?
> 
> What should be the actual value?
> 
> I have attached the userconfig.xml and orb1.xml files for reference.
<snip/>


Jeremias Maerki


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


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
You register the font as "PrecisionIDOCRB1DEMO" in the configuration but
refer to it as "PrecisionID OCR B1 DEMO" in XSL-FO. Notice the spaces!


On 05.04.2006 15:20:28 Archana Visveswaran, ASDC Chennai wrote:
> Hi,
>  
> Thanks for the info. I have created the metric file for OCR B1 font.
> I have included this in the userconfig.xml file using these lines.
>  
> <font metrics-file="C:\ocrb1.xml" kerning="yes"
>         embed-file="C:\WINNT\Fonts\PrecisionID OCR B1 DEMO.ttf">
>    <font-triplet name="PrecisionIDOCRB1DEMO" style="normal" weight="normal"/>  
>   </font>  
>  
> Is there any error in the above lines? Because I still get this message while converting:
> [ERROR] unknown font PrecisionID OCR B1 DEMO,normal,bold so defaulted font to any
> How should this be resolved?

<snip/>


Jeremias Maerki


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


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I guess it should be possible to add cmap tables with a font editor, but
I've never done this. The other option is to improve FOP to handle
TrueType fonts without a cmap table. I can't imagine that it's difficult,
it's just that somebody has to sit down and take it on.

On 01.05.2006 19:00:37 Susant wrote:
> 
> Thank you Jeremi.
> 
> I was using that logo as an image with a very high resolution. Let me try it
> out with svg.
> Is there any way to add a cmap table in these kind of fonts? Because i still
> have a whole set of fonts which has the same problem. My FOP version is
> '0.20.5'.
> 
> Error message:
> 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)


Jeremias Maerki


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


Re: Error while creating metric file

Posted by Susant <su...@ebusinessware.com>.
Thank you Jeremi.

I was using that logo as an image with a very high resolution. Let me try it
out with svg.
Is there any way to add a cmap table in these kind of fonts? Because i still
have a whole set of fonts which has the same problem. My FOP version is
'0.20.5'.

Error message:
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)

--
View this message in context: http://www.nabble.com/Error-while-creating-metric-file-t1398534.html#a4172244
Sent from the FOP - Users forum at Nabble.com.


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


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 28.04.2006 23:12:34 Susant wrote:
> 
> Archna,
> I would like to know how you generated the metrics file for that OCR font.

He probably generated it like any other font.

> I've a font that generates a logo which says it's a TrueType font, but
> complains while generating metrics file using TTFReader.

TTFReader cannot process every TrueType font. I assume you get an error
message about a missing "cmap table". BTW, it's always a good idea to
say which FOP version you use and what exactly the error messages are.
I assume you're using a custom-built font (since it's producing a logo)
and that's why the "cmap" table is not available. You're out of luck
with FOP to process this font for now. I suggest you use a painting
program (like CorelDraw or Illustrator) to paint the logos contained in
the font and export each as an SVG graphic (with text converted to
shapes).

Jeremias Maerki


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


RE: Error while creating metric file

Posted by Susant <su...@ebusinessware.com>.
Archna,
I would like to know how you generated the metrics file for that OCR font.
I've a font that generates a logo which says it's a TrueType font, but
complains while generating metrics file using TTFReader.

Suggestion would be appreciated.

Sus
--
View this message in context: http://www.nabble.com/Error-while-creating-metric-file-t1398534.html#a4147728
Sent from the FOP - Users forum at Nabble.com.


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


Re: Error while creating metric file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Indeed, Windows' Webdings and Symbol TrueType fonts cannot be processed
by TTFReader and can therefore not be used with FOP at the moment. For
the Symbol font this is not tragic because the Symbol font is one of the
base14 fonts which are simply available in FOP. For the other fonts,
this is a problem. In the last few months a number of people have
reported problems with certain fonts. One would hope that the itch to
make these fonts work would at some point be enough to get someone to
look into the problem. Patches are always welcome. Otherwise, you'll
have to live with these restrictions.

Alternatives are to find other fonts, possibly in Type 1 format, or to
use SVG graphics instead of the Webdings fonts, for example.

On 05.04.2006 12:04:16 Archana Visveswaran, ASDC Chennai wrote:
> Hi, 
>  
> I am using fop-0.20.5.
> I need to create a metric file for Webdings, OCR font and Symbol. But I
> get the following error:
>  
> Reading C:\WINNT\Fonts\Symbol.ttf...
>  
> Number of glyphs in font: 192
> 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 saw a similar post but the solution was not provided. 
> How can I write the metric file? I am using 1.4.2_03 version of Java.
> My aim is to convert an fo file to pdf. This uses Symbol and OCR font.
> Is there any way these fonts can be included or do we have any
> restrictions while using FOP?



Jeremias Maerki


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