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 Steve Ebersole <st...@hibernate.org> on 2009/06/08 17:06:47 UTC

Re: Font registration

Back at this yet again.

This time I added a feature to the maven plugin to actually dump the FO
file (I actually use the SAX approach for rendering, so iit was
previously not needed).  I am attaching it here.  As a total noob I have
no clue what to look for.  I do see the correct font-family selections
in the FO file.  I also added some output from my XSLT where I specify
the pickfont selections and verified that those are correct.

Yet I see lots of warning log messages which seem related to not being
able to locate the fonts.  Things like certain glyphs not being
available, etc.  I've attached the log output as well, but here is an
example:

WARNING: Font "Symbol,normal,700" not found. Substituting with
"Symbol,normal,400".
WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
"ZapfDingbats,normal,400".
WARNING: Glyph "符" (0x7b26) not available in font "Helvetica-Bold".





On Tue, 2009-04-07 at 19:32 +0200, Andreas Delmelle wrote:
> On 07 Apr 2009, at 17:39, Steve Ebersole wrote:
> 
> Hi Steve
> 
> > I tried a mixture of the two.  I have a problem though.
> > FontInfoFinder.find is returning me null. Basically I have a directory
> > of fonts (.ttf and .ttc).  I was trying the following code fragment
> > (which is where FontInfoFinder.find is returning null):
> > <snip />
> >
> > So basically, for each direcrtory containing fonts
> > (environment.getFontDirectories()), I iterate the files
> > (fontDirectory.listFiles()).  So fontFile is the .ttf files.  I have
> > verified this in debugger.  Yet when fontInfoFinder.find is called on
> > that .ttf file, it returns null.
> 
> Most likely an issue with the TTF file. FOP still chokes on some TTFs  
> (mostly on Linux and Mac OS, or OTF variants)
> Do you get any log output indicating such a problem?
> 
> Checking the code, FontInfoFinder.find() will return null if:
> * there is a FontCache and the file has failed to load on a previous  
> attempt. We only display the corresponding message if the log-level is  
> set to DEBUG.
> 
> * the file failed to load, but it is the first attempt. In FOP Trunk,  
> a message is then broadcast to the attached EventListener (if it has  
> been registered).
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org

Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Lol, ok that was it.  Somehow that bad entry got put into the cache and
was always used there-after.

Which brings up the question about guidelines for programatic use of 
FontCache.load().  Do I use it, and just tell my users to delete that
cache file if they encounter problems?  Do I add an option to clear the
font cache?  Do I just not use it?

Anyway, thanks for your help Andreas.

On Mon, 2009-06-15 at 23:27 +0200, Andreas Delmelle wrote:
> On 15 Jun 2009, at 21:44, Steve Ebersole wrote:
> 
> Hi Steve
> 
> > Now running with FOP trunk, but still have the same exact issue.  For
> > this TTC file, FontInfoFinder.find() is returning a single  
> > EmbedFontInfo
> > object which has no sub-font name.  It does however have 2
> > EmbedFontInfo.fontTriplets entries:
> > [0] = "AR PL UMing CN,normal,400"
> > [1] = "UMingCN,normal,400"
> >
> > This is exactly what the patched docx4j version was giving me for this
> > TTC.
> >
> > So is this the expected behavior?
> 
> No, I don't believe so, unless we're not seeing some relevant messages  
> about failures trying to load the other fonts in the collection. I  
> don't have a TTC at hand here to test with, otherwise I'd debug it to  
> see what's going on... Have you already tried this with other TTCs? Do  
> they exhibit the same behavior? If not, then it probably points to a  
> peculiarity in the file that we didn't account for.
> 
> 
> Regards
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Just to finish up on this, I need to do a release of my jDocBook plugin
for maven and I need to make use of this functionality.  So I need to
make use of FOP 0.95++.

First obvious question is when is 0.96 expected?

Second, I can do a "snapshot" build of FOP from the sources I have here.
For the lib/xmlgraphics-commons-1.4svn.jar, was there a particular tag
from which that was pulled and built?

On Mon, 2009-06-15 at 23:59 +0200, Andreas Delmelle wrote:
> On 15 Jun 2009, at 23:33, Steve Ebersole wrote:
> 
> > I am debugging through the code right now.  I am currently looking at
> > FontCache.  I was not expecting cache hits, I did not realize that the
> > cache was persistent.
> 
> Yes. I'm still not /completely/ up to speed as to what happens there,  
> but that I know for certain. Obviously, we want to avoid, as much as  
> possible, to open/read the font-file each and every time the font is  
> referenced. In fact, it goes so far that, if a font-file has failed to  
> load *and* the cache is not invalidated/deleted, the file will never  
> be checked again, except for the modification timestamp. FOP will only  
> retry parsing if the FontCache's serialVersionUID has been modified,  
> or the physical file appears more recent than the one that failed to  
> load.
> 
> <snip />
> > Which brings up the question about guidelines for programatic use of
> > FontCache.load().  Do I use it, and just tell my users to delete that
> > cache file if they encounter problems?  Do I add an option to clear  
> > the
> > font cache?  Do I just not use it?
> 
> That's entirely up to you. For regular embedded usage, if you want to  
> be absolutely sure that all the info is reconstituted from scratch,  
> the 'useCache' option on the FontManager allows you to do just that.  
> In your case, the fact that FontInfoFinder only does something with  
> the FontCache if it is non-null could be used to the same end.
> There is obviously a price to pay in terms of processing time  
> (increased/repeated disk I/O)
> I think the cache offers a significant benefit in a good deal of  
> common use-cases, so I'd personally only disable it after repeatedly  
> running into problems.
> 
> 
> Regards
> 
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 15 Jun 2009, at 23:33, Steve Ebersole wrote:

> I am debugging through the code right now.  I am currently looking at
> FontCache.  I was not expecting cache hits, I did not realize that the
> cache was persistent.

Yes. I'm still not /completely/ up to speed as to what happens there,  
but that I know for certain. Obviously, we want to avoid, as much as  
possible, to open/read the font-file each and every time the font is  
referenced. In fact, it goes so far that, if a font-file has failed to  
load *and* the cache is not invalidated/deleted, the file will never  
be checked again, except for the modification timestamp. FOP will only  
retry parsing if the FontCache's serialVersionUID has been modified,  
or the physical file appears more recent than the one that failed to  
load.

<snip />
> Which brings up the question about guidelines for programatic use of
> FontCache.load().  Do I use it, and just tell my users to delete that
> cache file if they encounter problems?  Do I add an option to clear  
> the
> font cache?  Do I just not use it?

That's entirely up to you. For regular embedded usage, if you want to  
be absolutely sure that all the info is reconstituted from scratch,  
the 'useCache' option on the FontManager allows you to do just that.  
In your case, the fact that FontInfoFinder only does something with  
the FontCache if it is non-null could be used to the same end.
There is obviously a price to pay in terms of processing time  
(increased/repeated disk I/O)
I think the cache offers a significant benefit in a good deal of  
common use-cases, so I'd personally only disable it after repeatedly  
running into problems.


Regards


Andreas


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
I am debugging through the code right now.  I am currently looking at
FontCache.  I was not expecting cache hits, I did not realize that the
cache was persistent.  

Anyway, I'll go as far as I can here.

On Mon, 2009-06-15 at 23:27 +0200, Andreas Delmelle wrote:
> On 15 Jun 2009, at 21:44, Steve Ebersole wrote:
> 
> Hi Steve
> 
> > Now running with FOP trunk, but still have the same exact issue.  For
> > this TTC file, FontInfoFinder.find() is returning a single  
> > EmbedFontInfo
> > object which has no sub-font name.  It does however have 2
> > EmbedFontInfo.fontTriplets entries:
> > [0] = "AR PL UMing CN,normal,400"
> > [1] = "UMingCN,normal,400"
> >
> > This is exactly what the patched docx4j version was giving me for this
> > TTC.
> >
> > So is this the expected behavior?
> 
> No, I don't believe so, unless we're not seeing some relevant messages  
> about failures trying to load the other fonts in the collection. I  
> don't have a TTC at hand here to test with, otherwise I'd debug it to  
> see what's going on... Have you already tried this with other TTCs? Do  
> they exhibit the same behavior? If not, then it probably points to a  
> peculiarity in the file that we didn't account for.
> 
> 
> Regards
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 15 Jun 2009, at 21:44, Steve Ebersole wrote:

Hi Steve

> Now running with FOP trunk, but still have the same exact issue.  For
> this TTC file, FontInfoFinder.find() is returning a single  
> EmbedFontInfo
> object which has no sub-font name.  It does however have 2
> EmbedFontInfo.fontTriplets entries:
> [0] = "AR PL UMing CN,normal,400"
> [1] = "UMingCN,normal,400"
>
> This is exactly what the patched docx4j version was giving me for this
> TTC.
>
> So is this the expected behavior?

No, I don't believe so, unless we're not seeing some relevant messages  
about failures trying to load the other fonts in the collection. I  
don't have a TTC at hand here to test with, otherwise I'd debug it to  
see what's going on... Have you already tried this with other TTCs? Do  
they exhibit the same behavior? If not, then it probably points to a  
peculiarity in the file that we didn't account for.


Regards

Andreas


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Now running with FOP trunk, but still have the same exact issue.  For
this TTC file, FontInfoFinder.find() is returning a single EmbedFontInfo
object which has no sub-font name.  It does however have 2
EmbedFontInfo.fontTriplets entries:
[0] = "AR PL UMing CN,normal,400"
[1] = "UMingCN,normal,400"

This is exactly what the patched docx4j version was giving me for this
TTC.

So is this the expected behavior?



On Mon, 2009-06-15 at 21:13 +0200, Andreas Delmelle wrote:
> On 15 Jun 2009, at 21:07, Steve Ebersole wrote:
> 
> > So I went ahead and built trunk via 'ant maven-artifacts' and  
> > installed
> > the resultant artifacts into my local repo.
> >
> > I then tried re-running my transformation, but am now getting
> > "NoClassDefFoundError:
> > org/apache/xmlgraphics/util/uri/CommonURIResolver"
> 
> No Maven experience here, but it seems you're missing the latest  
> version of the XMLGraphics Common JAR.
> 
> http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar?view=log
> 
> 
> Regards
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Thanks for the reply Andreas.  That's actually a problem with the pom
generated by FOP's ant build then.  It does name xmlgraphics-commons as
a dependency, but it lists 1.3.

I'll try to update that and try again...


On Mon, 2009-06-15 at 21:13 +0200, Andreas Delmelle wrote:
> On 15 Jun 2009, at 21:07, Steve Ebersole wrote:
> 
> > So I went ahead and built trunk via 'ant maven-artifacts' and  
> > installed
> > the resultant artifacts into my local repo.
> >
> > I then tried re-running my transformation, but am now getting
> > "NoClassDefFoundError:
> > org/apache/xmlgraphics/util/uri/CommonURIResolver"
> 
> No Maven experience here, but it seems you're missing the latest  
> version of the XMLGraphics Common JAR.
> 
> http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar?view=log
> 
> 
> Regards
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 15 Jun 2009, at 21:07, Steve Ebersole wrote:

> So I went ahead and built trunk via 'ant maven-artifacts' and  
> installed
> the resultant artifacts into my local repo.
>
> I then tried re-running my transformation, but am now getting
> "NoClassDefFoundError:
> org/apache/xmlgraphics/util/uri/CommonURIResolver"

No Maven experience here, but it seems you're missing the latest  
version of the XMLGraphics Common JAR.

http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/lib/xmlgraphics-commons-1.4svn.jar?view=log


Regards

Andreas


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
So I went ahead and built trunk via 'ant maven-artifacts' and installed
the resultant artifacts into my local repo.

I then tried re-running my transformation, but am now getting
"NoClassDefFoundError:
org/apache/xmlgraphics/util/uri/CommonURIResolver"


On Wed, 2009-06-10 at 13:22 -0500, Steve Ebersole wrote:
> On Wed, 2009-06-10 at 19:45 +0200, Andreas Delmelle wrote:
> > On 10 Jun 2009, at 19:07, Steve Ebersole wrote:
> > 
> > Hi Steve
> > 
> > > For example, on this TTC file TTFReader is showing 4 fonts/subfonts:
> > > This is a TrueType collection file with 4 fonts
> > > Containing the following fonts:
> > > AR PL UMing CN <-- selected
> > > AR PL UMing HK
> > > AR PL UMing TW
> > > AR PL UMing TW MBE
> > > Font Family: [AR PL UMing CN]
> > > Creating xml font file...
> > > Creating CID encoded metrics...
> > > Writing xml font file example-font-metrics.xml...
> > > This font contains no embedding license restrictions.
> > >
> > > The one marked "<-- selected" is the one that is coming back from my
> > > call to org.apache.fop.fonts.autodetect.FontInfoFinder#find.
> > 
> > I think that is because it is the only sub-font that is referenced in  
> > your config snippet earlier...
> Actually its the other way around.  I am constructing that config
> snippet based on what
> org.apache.fop.fonts.autodetect.FontInfoFinder#find is returning.
> 
> > Try leaving out the explicit font element in the configuration file  
> > altogether. I'm not a 100% certain, but I believe that is causing the  
> > confusion here. Explicit individual font elements in the configuration  
> > file take precedence over those generated by auto-detection.
> But from where will the auto-detection take place?  I am trying to avoid
> having to have users "setting up their system" by installing fonts.
> This code is used as part of localized project docbook builds.
> 
> > Either remove it, or add an additional three for the other sub-fonts.
> Ok, but again I am not sure how to do that based on the EmbedFontInfo
> info FontInfoFinder is returning to me in order to add the other 3.
> 
> > Indeed, and looking at the code, I cannot see why that would not be  
> > the case here...
> Could it be the patched version I am using?  As I mentioned, I am using
> a patched fop from docx4j versioned as 0.95.756434.  I think it was
> Jason as well who pointed me at that one because the current fop
> releases are not returning an array of EmbedFontInfo instances from
> FontInfoFinder.  Anyway, there was some signature difference.
> 
> > 
> > 
> > Andreas
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
On Wed, 2009-06-10 at 19:45 +0200, Andreas Delmelle wrote:
> On 10 Jun 2009, at 19:07, Steve Ebersole wrote:
> 
> Hi Steve
> 
> > For example, on this TTC file TTFReader is showing 4 fonts/subfonts:
> > This is a TrueType collection file with 4 fonts
> > Containing the following fonts:
> > AR PL UMing CN <-- selected
> > AR PL UMing HK
> > AR PL UMing TW
> > AR PL UMing TW MBE
> > Font Family: [AR PL UMing CN]
> > Creating xml font file...
> > Creating CID encoded metrics...
> > Writing xml font file example-font-metrics.xml...
> > This font contains no embedding license restrictions.
> >
> > The one marked "<-- selected" is the one that is coming back from my
> > call to org.apache.fop.fonts.autodetect.FontInfoFinder#find.
> 
> I think that is because it is the only sub-font that is referenced in  
> your config snippet earlier...
Actually its the other way around.  I am constructing that config
snippet based on what
org.apache.fop.fonts.autodetect.FontInfoFinder#find is returning.

> Try leaving out the explicit font element in the configuration file  
> altogether. I'm not a 100% certain, but I believe that is causing the  
> confusion here. Explicit individual font elements in the configuration  
> file take precedence over those generated by auto-detection.
But from where will the auto-detection take place?  I am trying to avoid
having to have users "setting up their system" by installing fonts.
This code is used as part of localized project docbook builds.

> Either remove it, or add an additional three for the other sub-fonts.
Ok, but again I am not sure how to do that based on the EmbedFontInfo
info FontInfoFinder is returning to me in order to add the other 3.

> Indeed, and looking at the code, I cannot see why that would not be  
> the case here...
Could it be the patched version I am using?  As I mentioned, I am using
a patched fop from docx4j versioned as 0.95.756434.  I think it was
Jason as well who pointed me at that one because the current fop
releases are not returning an array of EmbedFontInfo instances from
FontInfoFinder.  Anyway, there was some signature difference.

> 
> 
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 10 Jun 2009, at 19:07, Steve Ebersole wrote:

Hi Steve

> For example, on this TTC file TTFReader is showing 4 fonts/subfonts:
> This is a TrueType collection file with 4 fonts
> Containing the following fonts:
> AR PL UMing CN <-- selected
> AR PL UMing HK
> AR PL UMing TW
> AR PL UMing TW MBE
> Font Family: [AR PL UMing CN]
> Creating xml font file...
> Creating CID encoded metrics...
> Writing xml font file example-font-metrics.xml...
> This font contains no embedding license restrictions.
>
> The one marked "<-- selected" is the one that is coming back from my
> call to org.apache.fop.fonts.autodetect.FontInfoFinder#find.

I think that is because it is the only sub-font that is referenced in  
your config snippet earlier...

Try leaving out the explicit font element in the configuration file  
altogether. I'm not a 100% certain, but I believe that is causing the  
confusion here. Explicit individual font elements in the configuration  
file take precedence over those generated by auto-detection.

Either remove it, or add an additional three for the other sub-fonts.

> The returned org.apache.fop.fonts.EmbedFontInfo object has no sub- 
> font name
> associated with it; the only place that "AR PL UMing CN" shows up is  
> if
> I grab the first font triplet from the EmbedFontInfo as outlined in  
> the
> code snippet from the previous email (its code Jason Harrop pointed  
> out
> to me).  That triplet has FontTriplet.getName() == "AR PL UMing CN".
> There is a second FontTriplet associated with that EmbedFontInfo, with
> getName() == "UMingCN" (not sure where that name comes from).

I think this is auto-generated (the PostScript name?)

> Again I just want to verify that this is the intent.  Can I code to  
> this
> behavior and have it continue to work?  Or would you consider this a
> bug?

I'm not sure. It does at least seem odd behavior.

> To me, I would think I should get back 4 EmbedFontInfo objects
> when I call org.apache.fop.fonts.autodetect.FontInfoFinder#find on  
> this
> ttc file: fontInfos[0].subFontName=="AR PL UMing CN",
> fontInfos[1].subFontName=="AR PL UMing HK", etc (maybe 8 total  
> depending
> on where that "UMingCN" comes from).

Indeed, and looking at the code, I cannot see why that would not be  
the case here...


Andreas

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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
TTFReader did show the sub-fonts.

The problem is that I am trying to do this programatically.  So I do not
really have this information ahead of time.  I was merely using
TTFReader in order to try to understand perhaps what the <font/> mapping
should look like exactly.  So at this point I am not sure exactly to
what format I need to alter the config.  For example, can I treat this
universally and say that all all <font/> definitions from all
EmbedFontInfo will have name/subFontName the same whether its a ttf file
or ttc file?  If not, how can I tell that an EmbedFontInfo represents a
TrueType Collection?  Is the only option to see whether the embed file
ends has a .ttc extebsion?


For example, on this TTC file TTFReader is showing 4 fonts/subfonts:
This is a TrueType collection file with 4 fonts
Containing the following fonts: 
AR PL UMing CN <-- selected
AR PL UMing HK
AR PL UMing TW
AR PL UMing TW MBE
Font Family: [AR PL UMing CN]
Creating xml font file...
Creating CID encoded metrics...
Writing xml font file example-font-metrics.xml...
This font contains no embedding license restrictions.

The one marked "<-- selected" is the one that is coming back from my
call to org.apache.fop.fonts.autodetect.FontInfoFinder#find.  The
returned org.apache.fop.fonts.EmbedFontInfo object has no sub-font name
associated with it; the only place that "AR PL UMing CN" shows up is if
I grab the first font triplet from the EmbedFontInfo as outlined in the
code snippet from the previous email (its code Jason Harrop pointed out
to me).  That triplet has FontTriplet.getName() == "AR PL UMing CN".
There is a second FontTriplet associated with that EmbedFontInfo, with
getName() == "UMingCN" (not sure where that name comes from).

Again I just want to verify that this is the intent.  Can I code to this
behavior and have it continue to work?  Or would you consider this a
bug?  To me, I would think I should get back 4 EmbedFontInfo objects
when I call org.apache.fop.fonts.autodetect.FontInfoFinder#find on this
ttc file: fontInfos[0].subFontName=="AR PL UMing CN",
fontInfos[1].subFontName=="AR PL UMing HK", etc (maybe 8 total depending
on where that "UMingCN" comes from).



On Wed, 2009-06-10 at 18:42 +0200, Andreas Delmelle wrote:
> On 10 Jun 2009, at 16:29, Steve Ebersole wrote:
> 
> > P.S.  I tried running org.apache.fop.fonts.apps.TTFReader to generate
> > the metrics file just to see what FOP itself would recognize here.   
> > But
> > unfortunately I got a resultant metrics file that no text editor on
> > earth seems to be able to open; well OK, no text editor on my  
> > system :)
> 
> Didn't the TTFReader show a list of the sub-fonts before exiting?
> 
> The only thing I can think of now, is that there's something special  
> about that .TTC file...
> 
> You did alter the config as suggested earlier, right? (add the sub- 
> font to the font-element)
> 
> 
> 
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 10 Jun 2009, at 16:29, Steve Ebersole wrote:

> P.S.  I tried running org.apache.fop.fonts.apps.TTFReader to generate
> the metrics file just to see what FOP itself would recognize here.   
> But
> unfortunately I got a resultant metrics file that no text editor on
> earth seems to be able to open; well OK, no text editor on my  
> system :)

Didn't the TTFReader show a list of the sub-fonts before exiting?

The only thing I can think of now, is that there's something special  
about that .TTC file...

You did alter the config as suggested earlier, right? (add the sub- 
font to the font-element)



Andreas

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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
P.S.  I tried running org.apache.fop.fonts.apps.TTFReader to generate
the metrics file just to see what FOP itself would recognize here.  But
unfortunately I got a resultant metrics file that no text editor on
earth seems to be able to open; well OK, no text editor on my system :)


On Wed, 2009-06-10 at 09:26 -0500, Steve Ebersole wrote:
> So here is the code fragment I use to load the "font info":
> 
> FontCache fontCache = FontCache.load();
> if ( fontCache == null ) {
>     fontCache = new FontCache();
> }
> 
> FontInfoFinder fontInfoFinder = new FontInfoFinder();
> 
> // fontResolver below is a custom font resolver which 
> // just does some logging while delegating to the 
> // resolver returned from FontSetup.createMinimalFontResolver()
> 
> for ( File fontFile : fontDirectory.listFiles() ) {
>     EmbedFontInfo[] infos = fontInfoFinder.find( 
>             toURL( fontFile ), 
>             fontResolver, 
>             fontCache 
>     );
> 
>     if ( infos == null || infos.length == 0 ) {
>         // log error
>         continue;
>     }
> 
>     for ( EmbedFontInfo info : infos ) {
>         // log some info...
>         if ( info.getEmbedFile() != null ) {
>             infoList.add( info );
>         }
>     }
> }
> 
> However, the fontInfoFinder.find() call is returning just a single font
> info for the TTC file (just this particular TTC file maybe?).  And that
> single font info has no sub-font name associated with it.  It seems to
> recognize only one of the sub-fonts (not sure if it is just coincidence,
> but it appears to recognize the first sub-font).  Is this the intended
> behavior?
> 
> BTW, this is using a patched fop from docx4j versioned as 0.95.756434 if
> that makes any difference.
> 
> 
> On Wed, 2009-06-10 at 08:21 +0200, Andreas Delmelle wrote:
> > On 10 Jun 2009, at 06:18, Steve Ebersole wrote:
> > 
> > Hi Steve
> > 
> > > Anyone please?  Do we just need to say this is not going to work for  
> > > TTC
> > > files?  I am just setting this up incorrectly?
> > 
> > Sorry for the late reply.
> > 
> > See: http://xmlgraphics.apache.org/fop/trunk/fonts.html#truetype-collections-metrics
> > 
> > You have to register each sub-font in the TTC, by means of a "sub- 
> > font" attribute on the font element.
> > 
> > 
> > HTH!
> > 
> > Andreas
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
So here is the code fragment I use to load the "font info":

FontCache fontCache = FontCache.load();
if ( fontCache == null ) {
    fontCache = new FontCache();
}

FontInfoFinder fontInfoFinder = new FontInfoFinder();

// fontResolver below is a custom font resolver which 
// just does some logging while delegating to the 
// resolver returned from FontSetup.createMinimalFontResolver()

for ( File fontFile : fontDirectory.listFiles() ) {
    EmbedFontInfo[] infos = fontInfoFinder.find( 
            toURL( fontFile ), 
            fontResolver, 
            fontCache 
    );

    if ( infos == null || infos.length == 0 ) {
        // log error
        continue;
    }

    for ( EmbedFontInfo info : infos ) {
        // log some info...
        if ( info.getEmbedFile() != null ) {
            infoList.add( info );
        }
    }
}

However, the fontInfoFinder.find() call is returning just a single font
info for the TTC file (just this particular TTC file maybe?).  And that
single font info has no sub-font name associated with it.  It seems to
recognize only one of the sub-fonts (not sure if it is just coincidence,
but it appears to recognize the first sub-font).  Is this the intended
behavior?

BTW, this is using a patched fop from docx4j versioned as 0.95.756434 if
that makes any difference.


On Wed, 2009-06-10 at 08:21 +0200, Andreas Delmelle wrote:
> On 10 Jun 2009, at 06:18, Steve Ebersole wrote:
> 
> Hi Steve
> 
> > Anyone please?  Do we just need to say this is not going to work for  
> > TTC
> > files?  I am just setting this up incorrectly?
> 
> Sorry for the late reply.
> 
> See: http://xmlgraphics.apache.org/fop/trunk/fonts.html#truetype-collections-metrics
> 
> You have to register each sub-font in the TTC, by means of a "sub- 
> font" attribute on the font element.
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Andreas Delmelle <an...@telenet.be>.
On 10 Jun 2009, at 06:18, Steve Ebersole wrote:

Hi Steve

> Anyone please?  Do we just need to say this is not going to work for  
> TTC
> files?  I am just setting this up incorrectly?

Sorry for the late reply.

See: http://xmlgraphics.apache.org/fop/trunk/fonts.html#truetype-collections-metrics

You have to register each sub-font in the TTC, by means of a "sub- 
font" attribute on the font element.


HTH!

Andreas


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Anyone please?  Do we just need to say this is not going to work for TTC
files?  I am just setting this up incorrectly?


On Tue, 2009-06-09 at 10:28 -0500, Steve Ebersole wrote:
> Ooops, I had temporarily disabled the font registration code at one
> point to try to work around stuff and forgotten to re-enable it.  After
> re-enabling it, I am getting an exception about reading a TrueType font
> collection.  I have only one ttc file (uming.ttc), so i have to assume
> it is that one being processed.
> 
> The userconfig is generated by my code, and here is what gets passed in:
> <fop version="1.0">
>   <strict-configuration>true</strict-configuration>
>   <renderers>
>     <renderer mime="application/pdf">
>       <fonts>
>         ...
>         <font
> embed-url="file:/home/steve/projects/sandbox/jdocbook/target/docbook/staging/fonts/uming.ttc">
>           <font-triplet 
>               style="normal" 
>               name="AR PL UMing CN" 
>               weight="normal"/>
>           <font-triplet 
>               style="normal" 
>               name="AR PL UMing CN" 
>               weight="bold"/>
>           <font-triplet 
>               style="italic" 
>               name="AR PL UMing CN" 
>               weight="bold"/>
>            <font-triplet 
>               style="italic" 
>               name="AR PL UMing CN" 
>               weight="normal"/>
>         </font>
>       </fonts>
>     </renderer>
>   </renderers>
> </fop>
> 
> 
> I have attached the output log as well as the fragments of java code
> used to create this userconfig.
> 
> 
> Here is the snipped exception (present in the log too):
> 
> java.lang.IllegalArgumentException: For TrueType collection you must
> specify which font to select (-ttcname)
> 	at org.apache.fop.fonts.truetype.TTFFile.readFont(TTFFile.java:480)
> 	at
> org.apache.fop.fonts.truetype.TTFFontLoader.read(TTFFontLoader.java:98)
> 	at
> org.apache.fop.fonts.truetype.TTFFontLoader.read(TTFFontLoader.java:84)
> 	at org.apache.fop.fonts.FontLoader.getFont(FontLoader.java:190)
> 	at org.apache.fop.fonts.FontLoader.loadFont(FontLoader.java:139)
> 	at org.apache.fop.fonts.LazyFont.load(LazyFont.java:134)
> 	at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:241)
> 	at org.apache.fop.fonts.Font.getAscender(Font.java:106)
> 	at
> org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:89)
> 	at
> org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:119)
> 	at
> org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:75)
> 	at
> org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:144)
> 	at
> org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:553)
> 	at
> org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:136)
> 	at
> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:303)
> 	at
> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:265)
> 	at
> org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
> 	at
> org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
> 	at
> org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
> 	at org.apache.fop.fo.FOTreeBuilder
> $MainFOHandler.endElement(FOTreeBuilder.java:348)
> 	at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
> 	at
> com.icl.saxon.output.ContentHandlerProxy.endElement(ContentHandlerProxy.java:137)
> 	at com.icl.saxon.output.ProxyEmitter.endElement(ProxyEmitter.java:91)
> 	at
> com.icl.saxon.output.NamespaceEmitter.endElement(NamespaceEmitter.java:150)
> 	at
> com.icl.saxon.output.GeneralOutputter.writeEndTag(GeneralOutputter.java:681)
> 	at
> com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:293)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
> 	at
> com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
> 	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
> 	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
> 	at
> com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at
> com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
> 	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
> 	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
> 	at com.icl.saxon.Controller.defaultAction(Controller.java:271)
> 	at com.icl.saxon.Controller.applyTemplates(Controller.java:236)
> 	at
> com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
> 	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
> 	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
> 	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
> 	at
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
> 	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
> 	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
> 	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
> 	at com.icl.saxon.Controller.run(Controller.java:178)
> 	at com.icl.saxon.Controller.transformDocument(Controller.java:1086)
> 	at com.icl.saxon.Controller.transform(Controller.java:953)
> 	at
> org.jboss.jdocbook.render.impl.BasicRenderer.performRendering(BasicRenderer.java:165)
> 	at
> org.jboss.jdocbook.render.impl.BasicRenderer.render(BasicRenderer.java:153)
> 	at
> org.jboss.jdocbook.render.impl.BasicRenderer.render(BasicRenderer.java:98)
> 	at
> org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:112)
> 	at
> org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.doExecute(AbstractDocBookMojo.java:379)
> 	at
> org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:407)
> 	at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
> ...
> 
> 
> I am really at a loss.
> 
> 
> On Mon, 2009-06-08 at 10:07 -0500, Steve Ebersole wrote:
> > Back at this yet again.
> > 
> > This time I added a feature to the maven plugin to actually dump the FO
> > file (I actually use the SAX approach for rendering, so iit was
> > previously not needed).  I am attaching it here.  As a total noob I have
> > no clue what to look for.  I do see the correct font-family selections
> > in the FO file.  I also added some output from my XSLT where I specify
> > the pickfont selections and verified that those are correct.
> > 
> > Yet I see lots of warning log messages which seem related to not being
> > able to locate the fonts.  Things like certain glyphs not being
> > available, etc.  I've attached the log output as well, but here is an
> > example:
> > 
> > WARNING: Font "Symbol,normal,700" not found. Substituting with
> > "Symbol,normal,400".
> > WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
> > "ZapfDingbats,normal,400".
> > WARNING: Glyph "符" (0x7b26) not available in font "Helvetica-Bold".
> > 
> > 
> > 
> > 
> > 
> > On Tue, 2009-04-07 at 19:32 +0200, Andreas Delmelle wrote:
> > > On 07 Apr 2009, at 17:39, Steve Ebersole wrote:
> > > 
> > > Hi Steve
> > > 
> > > > I tried a mixture of the two.  I have a problem though.
> > > > FontInfoFinder.find is returning me null. Basically I have a directory
> > > > of fonts (.ttf and .ttc).  I was trying the following code fragment
> > > > (which is where FontInfoFinder.find is returning null):
> > > > <snip />
> > > >
> > > > So basically, for each direcrtory containing fonts
> > > > (environment.getFontDirectories()), I iterate the files
> > > > (fontDirectory.listFiles()).  So fontFile is the .ttf files.  I have
> > > > verified this in debugger.  Yet when fontInfoFinder.find is called on
> > > > that .ttf file, it returns null.
> > > 
> > > Most likely an issue with the TTF file. FOP still chokes on some TTFs  
> > > (mostly on Linux and Mac OS, or OTF variants)
> > > Do you get any log output indicating such a problem?
> > > 
> > > Checking the code, FontInfoFinder.find() will return null if:
> > > * there is a FontCache and the file has failed to load on a previous  
> > > attempt. We only display the corresponding message if the log-level is  
> > > set to DEBUG.
> > > 
> > > * the file failed to load, but it is the first attempt. In FOP Trunk,  
> > > a message is then broadcast to the attached EventListener (if it has  
> > > been registered).
> > > 
> > > 
> > > HTH!
> > > 
> > > Andreas
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > > 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


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


Re: Font registration

Posted by Steve Ebersole <st...@hibernate.org>.
Ooops, I had temporarily disabled the font registration code at one
point to try to work around stuff and forgotten to re-enable it.  After
re-enabling it, I am getting an exception about reading a TrueType font
collection.  I have only one ttc file (uming.ttc), so i have to assume
it is that one being processed.

The userconfig is generated by my code, and here is what gets passed in:
<fop version="1.0">
  <strict-configuration>true</strict-configuration>
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
        ...
        <font
embed-url="file:/home/steve/projects/sandbox/jdocbook/target/docbook/staging/fonts/uming.ttc">
          <font-triplet 
              style="normal" 
              name="AR PL UMing CN" 
              weight="normal"/>
          <font-triplet 
              style="normal" 
              name="AR PL UMing CN" 
              weight="bold"/>
          <font-triplet 
              style="italic" 
              name="AR PL UMing CN" 
              weight="bold"/>
           <font-triplet 
              style="italic" 
              name="AR PL UMing CN" 
              weight="normal"/>
        </font>
      </fonts>
    </renderer>
  </renderers>
</fop>


I have attached the output log as well as the fragments of java code
used to create this userconfig.


Here is the snipped exception (present in the log too):

java.lang.IllegalArgumentException: For TrueType collection you must
specify which font to select (-ttcname)
	at org.apache.fop.fonts.truetype.TTFFile.readFont(TTFFile.java:480)
	at
org.apache.fop.fonts.truetype.TTFFontLoader.read(TTFFontLoader.java:98)
	at
org.apache.fop.fonts.truetype.TTFFontLoader.read(TTFFontLoader.java:84)
	at org.apache.fop.fonts.FontLoader.getFont(FontLoader.java:190)
	at org.apache.fop.fonts.FontLoader.loadFont(FontLoader.java:139)
	at org.apache.fop.fonts.LazyFont.load(LazyFont.java:134)
	at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:241)
	at org.apache.fop.fonts.Font.getAscender(Font.java:106)
	at
org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:89)
	at
org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:119)
	at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:75)
	at
org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:144)
	at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:553)
	at
org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:136)
	at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:303)
	at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:265)
	at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
	at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
	at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
	at org.apache.fop.fo.FOTreeBuilder
$MainFOHandler.endElement(FOTreeBuilder.java:348)
	at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
	at
com.icl.saxon.output.ContentHandlerProxy.endElement(ContentHandlerProxy.java:137)
	at com.icl.saxon.output.ProxyEmitter.endElement(ProxyEmitter.java:91)
	at
com.icl.saxon.output.NamespaceEmitter.endElement(NamespaceEmitter.java:150)
	at
com.icl.saxon.output.GeneralOutputter.writeEndTag(GeneralOutputter.java:681)
	at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:293)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
	at
com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
	at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at
com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
	at com.icl.saxon.Controller.defaultAction(Controller.java:271)
	at com.icl.saxon.Controller.applyTemplates(Controller.java:236)
	at
com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
	at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
	at
com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
	at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
	at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
	at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
	at com.icl.saxon.Controller.run(Controller.java:178)
	at com.icl.saxon.Controller.transformDocument(Controller.java:1086)
	at com.icl.saxon.Controller.transform(Controller.java:953)
	at
org.jboss.jdocbook.render.impl.BasicRenderer.performRendering(BasicRenderer.java:165)
	at
org.jboss.jdocbook.render.impl.BasicRenderer.render(BasicRenderer.java:153)
	at
org.jboss.jdocbook.render.impl.BasicRenderer.render(BasicRenderer.java:98)
	at
org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:112)
	at
org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.doExecute(AbstractDocBookMojo.java:379)
	at
org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:407)
	at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
...


I am really at a loss.


On Mon, 2009-06-08 at 10:07 -0500, Steve Ebersole wrote:
> Back at this yet again.
> 
> This time I added a feature to the maven plugin to actually dump the FO
> file (I actually use the SAX approach for rendering, so iit was
> previously not needed).  I am attaching it here.  As a total noob I have
> no clue what to look for.  I do see the correct font-family selections
> in the FO file.  I also added some output from my XSLT where I specify
> the pickfont selections and verified that those are correct.
> 
> Yet I see lots of warning log messages which seem related to not being
> able to locate the fonts.  Things like certain glyphs not being
> available, etc.  I've attached the log output as well, but here is an
> example:
> 
> WARNING: Font "Symbol,normal,700" not found. Substituting with
> "Symbol,normal,400".
> WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with
> "ZapfDingbats,normal,400".
> WARNING: Glyph "符" (0x7b26) not available in font "Helvetica-Bold".
> 
> 
> 
> 
> 
> On Tue, 2009-04-07 at 19:32 +0200, Andreas Delmelle wrote:
> > On 07 Apr 2009, at 17:39, Steve Ebersole wrote:
> > 
> > Hi Steve
> > 
> > > I tried a mixture of the two.  I have a problem though.
> > > FontInfoFinder.find is returning me null. Basically I have a directory
> > > of fonts (.ttf and .ttc).  I was trying the following code fragment
> > > (which is where FontInfoFinder.find is returning null):
> > > <snip />
> > >
> > > So basically, for each direcrtory containing fonts
> > > (environment.getFontDirectories()), I iterate the files
> > > (fontDirectory.listFiles()).  So fontFile is the .ttf files.  I have
> > > verified this in debugger.  Yet when fontInfoFinder.find is called on
> > > that .ttf file, it returns null.
> > 
> > Most likely an issue with the TTF file. FOP still chokes on some TTFs  
> > (mostly on Linux and Mac OS, or OTF variants)
> > Do you get any log output indicating such a problem?
> > 
> > Checking the code, FontInfoFinder.find() will return null if:
> > * there is a FontCache and the file has failed to load on a previous  
> > attempt. We only display the corresponding message if the log-level is  
> > set to DEBUG.
> > 
> > * the file failed to load, but it is the first attempt. In FOP Trunk,  
> > a message is then broadcast to the attached EventListener (if it has  
> > been registered).
> > 
> > 
> > HTH!
> > 
> > Andreas
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org