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: [email protected]
> For additional commands, e-mail: [email protected]
> 
-- 
Steve Ebersole <[email protected]>
Hibernate.org


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

Reply via email to