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 "Sharma (EXT), Ashish" <as...@siemens.com> on 2022/06/22 13:44:06 UTC
FOP-2.6 Custom Font are Not rendered in PDF
HI ,
After updating to FOP 2.6, while trying to use Apache FOP to use custom fonts GT Super Display Light, I am getting below error.
org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "Arial,normal,700" not found. Substituting with "any,normal,700".
org.apache.fop.events.LoggingEventListener processEvent
WARNING: Font "GTSuperDisplayLight,normal,700" not found. Substituting with "any,normal,700".
Configuration file:
<fonts>
<auto-detect/>
<font kerning="yes" embed-url="GTSuperDisplayLight.ttf" embedding-mode="subset">
<font-triplet name="GTSuperDisplayLight" style="normal" weight="700" />
</font>
</fonts>
Java file:
File xconf = new File( getConfigFileURI( xslFullName ) );
FopConfParser parser = new FopConfParser( xconf ); //parsing configuration
FopFactoryBuilder builder = parser.getFopFactoryBuilder(); //building the factory with the user options
fopFactory = builder.build();
fopFactory = FopFactory.newInstance( new File( "." ).toURI() );
foUserAgent = fopFactory.newFOUserAgent();
bufferedOutputStream = new FileOutputStream( pdfFilename );
bufferedOutputStream = new BufferedOutputStream(
bufferedOutputStream );
private String getConfigFileURI( String xslFilePath )
{
File f = new File( xslFilePath );
String configFileURI = f.getParent() + "/userconfig.xml";
return configFileURI;
}
Thanks
Ashish
Ashish.sharma.ext@siemens.com