anyone? (happy to try and fix it, but need a little help pointing myself in
some direction (other than backwards!))



-----Original Message-----
From: Martin Edge [mailto:martin.e...@intellimail.com.au] 
Sent: Tuesday, 9 February 2010 1:51 PM
To: fop-dev@xmlgraphics.apache.org
Subject: RE: Font Loading via IF Rendering.

Hey Guys,

>From what I can ascertain, when converting from IF -> PS, the Intermediate
classes don't load the installed fonts, nor the configured fonts. 

AbstractBinaryWritingIFDocumentHandler.java 

Method:  public void setDefaultFontInfo(FontInfo fontInfo) {

Currently has:
       FontManager fontManager =
getUserAgent().getFactory().getFontManager();
        FontCollection[] fontCollections = new FontCollection[] {
                new
Base14FontCollection(fontManager.isBase14KerningEnabled())
        };

Which when you get to the point of getInternalFontKey and look at the
triplets object, it seems to only contain the Base14 Fonts. What I found out
though, is if I put the following:

       FontManager fontManager =
getUserAgent().getFactory().getFontManager();
        Graphics2D graphics2D =
Java2DFontMetrics.createFontMetricsGraphics2D();
        FontCollection[] fontCollections = new FontCollection[] {
                new
Base14FontCollection(fontManager.isBase14KerningEnabled()),
                new InstalledFontCollection(graphics2D)
        };

Where I have reused the same method of retrieving the 2D fonts, and install
my special font, suddenly it can find the font in the triplets collection
and moves forward to render. It doesn't seem to render the font correctly,
but the point in this test was to show that the existing font configuration
in this scenario is not being loaded.

What do you think? 
Martin





-----Original Message-----
From: Martin Edge [mailto:martin.e...@intellimail.com.au] 
Sent: Tuesday, 9 February 2010 10:40 AM
To: 'fop-dev@xmlgraphics.apache.org'
Subject: RE: Font Loading via IF Rendering.

Hi Guys,

Also noticed, when I"m performing the IF -> PS Conversion...

The method which I'm guessing is to setup fonts doesn't seem to be called
anywhere? 

public static void setupFonts(IFDocumentHandler documentHandler, FontInfo
fontInfo)
                throws FOPException {

This is in IFUtil.java. 

So I am unsure where the font collection is actually being setup (if it is
at all) and if it is not, well I'm guessing this is the source of my
problem.

Thanks
Martin


-----Original Message-----
From: Martin Edge [mailto:martin.e...@intellimail.com.au] 
Sent: Tuesday, 9 February 2010 9:46 AM
To: 'fop-dev@xmlgraphics.apache.org'
Subject: Font Loading via IF Rendering.

Hey Guys,

Trying to get to the bottom of my inability to generate a PostScript file
from Intermediate File. 

Don't know much about the structure of the code, so I thought I'd comment on
what I've seen and see if there is any suggestion on where to look.

When converting from IF -> PS (and the original IF was generated with a
application/postscript MIME tag),

In PSPainter.java - In function drawText function: 
        fontKey = getFontInfo().getInternalFontKey(triplet);

Returns a null for my given font, even though the font was _not_ complained
about when I loaded 

I did notice when reviewing the 'triplets' collection that for all entries
in there, there was a substantial amount of null entries (like the loading
of some fonts failed?)

What populates the triplets collection?



Thanks
Martin.

 



Reply via email to