Hey Jeremias,

In the change set
(http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/
cli/IFInputHandler.java?r1=746664&r2=908410&pathrev=908410) you committed
was this:

-            documentHandler.setDefaultFontInfo(new FontInfo());
+            IFUtil.setupFonts(documentHandler);

I'm thinking that was the culprit - so far so good. Can render my special
fonts ;-)

Absolutely fantastic - now I just have to make it so I can use duplex and
tray selection via my edit-intermediate scripts and we're good to go.

Thanks so much!
Martin.



-----Original Message-----
From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] 
Sent: Wednesday, 10 February 2010 8:37 PM
To: fop-dev@xmlgraphics.apache.org
Cc: Martin Edge
Subject: Re: Font Loading via IF Rendering.

Martin,
I assume that the fonts were not properly configured in your case. While
testing I noticed that while my own test code worked fine, I got the
same error from the command-line. I've fixed that:
http://svn.apache.org/viewvc?rev=908410&view=rev

Could it be that you got your example code from IFInputHandler.java
instead of from the example code or the website? The document handler
needs to be configured by a call to IFUtil.setupFonts(IFDocumentHandler).
Otherwise, you only get the default base 14 fonts.

HTH

On 10.02.2010 07:27:22 Martin Edge wrote:
> 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.
> 
>  
> 
> 




Jeremias Maerki


Reply via email to