On 12.01.2009 13:46:05 Ulrich Mayring wrote:
> Jeremias Maerki wrote:
> > Executive summary: the AFM alone is usually sufficient.
> >
> > Both AFM and PFM contain a different set of font metrics. For
> > well-behaved Type1 fonts, the AFM alone is sufficient. When testing I
> > found at least one font where the PFM provided some information that
> > wasn't contained in the AFM. The Type1FontLoader class (responsible for
> > loading a Type 1 font) usually prefers information from the AFM if both
> > are available.
> 
> Thanks for the explanation, I gave it a go and got this:
> 
> SEVERE: Failed to read font metrics file null
> java.io.EOFException 
> 
>        at java.io.DataInputStream.readShort(DataInputStream.java:377) 
> 
>        at 
> org.apache.fop.fonts.type1.PFMInputStream.readShort(PFMInputStream.java:66) 
> 
>        at org.apache.fop.fonts.type1.PFMFile.loadKernPairs(PFMFile.java:188) 
> 
>        at org.apache.fop.fonts.type1.PFMFile.loadExtension(PFMFile.java:162) 

Looks like an malformed PFM file. I've had malformed PFMs before.

> Looking at the source code it appears there is a bug. Clearly, the font 
> metrics file is null in the exception output, but looking at LazyFont.java I 
> think that the actual metrics file to use is not determined from this 
> variable. As far as I can tell it is calculated from the embed-url filename 
> by swapping the extension.

Yes, the "metrics-url" attribute in the configuration refers to an XML
font metrics file. PFM and AFM files are found by changing the file
extension of the main font file (PFB in the case of Type1).

But I'm not convinced that this is a bug. Without the PFM in my hands, I
can't tell.

> The error itself seems to be an unexpected EOF. It would of course be helpful 
> to know which metrics file FOP was trying to process :)

If your PFB is myfont.pfb, FOP reads myfont.pfm in the same directory as
the PFB here.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to