[
https://issues.apache.org/jira/browse/FOP-3079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17559111#comment-17559111
]
Ashish Sharma commented on FOP-3079:
------------------------------------
Our Java code :
{color:#242424}try
{
/*
* Register Apache FOP to use our fonts. By default we set this config
file to auto-detect the fonts
* installed on the user's computer, but custom fonts can be specified.
Please refer to Apache FOP official
* documentation to do that.
*/{color}
{color:#242424} fopFactory = FopFactory.newInstance( new File(
getConfigFileURI( xslFullName ) ).toURI() );{color}
{color:#242424} foUserAgent = fopFactory.newFOUserAgent();
bufferedOutputStream = new FileOutputStream( pdfFilename );
bufferedOutputStream = new BufferedOutputStream(
bufferedOutputStream );
}
catch( Exception ex )
{
CMEReportPADPDFTranslate.logger.error( "Exception in CreatePDF() ->
setOutputStream(): " + ex );
}{color}
{color:#242424} //Setup XML input
Source src = new StreamSource(xmlFilename);
Source xsltSrc = new StreamSource(xslFullName);{color}
{color:#242424} try {
// Construct fop with desired output format
Fop fop =
fopFactory.newFop(org.apache.xmlgraphics.util.MimeConstants.MIME_PDF,
foUserAgent, bufferedOutputStream);{color}
{color:#242424} // Setup XSLT
// Specify TransformerFactoryImpl to allow CMEReportXalanDebug to work.
org.apache.xalan.processor.TransformerFactoryImpl transformerFactory
= new org.apache.xalan.processor.TransformerFactoryImpl();
Transformer transformer =
transformerFactory.newTransformer(xsltSrc);{color}
{color:#242424} // Set the value of a <param> in the stylesheet
transformer.setParameter("versionParam", "2.0");{color}
{color:#242424} // Resulting SAX events (the generated FO) must be piped
through to FOP
Result res = new SAXResult( fop.getDefaultHandler() );{color}
{color:#242424} // This is for debug settings.
CMEReportXalanDebug.addDebugMode(registry, transformer);
CMEReportPADPDFTranslate.logger.debug("Before transform");{color}
{color:#242424} // Start XSLT transformation and FOP processing
transformer.transform(src, res);{color}
{color:#242424} CMEReportPADPDFTranslate.logger.debug("After transform");
}{color}
> Fonts are Not getting rendered in FOP-2.6 while genrating PDF
> -------------------------------------------------------------
>
> Key: FOP-3079
> URL: https://issues.apache.org/jira/browse/FOP-3079
> Project: FOP
> Issue Type: Bug
> Components: font/opentype, renderer/pdf
> Affects Versions: 2.6
> Reporter: Ashish Sharma
> Priority: Blocker
>
> Fonts which Are Auto detected in FOP-2.4 is not Working in FOP-2.6 .
> <fonts>
> <!-- automatically detect operating system installed fonts -->
> <auto-detect/>
> <!-- embedded fonts -->
>
> <font kerning="yes" embed-url="GTSuperDisplayLight.ttf"
> embedding-mode="subset">
> <font-triplet name="GTSuperDisplayLight" style="normal"
> weight="700" />
> </font>
> </font>
>
> Throws This Error:
>
> WARNING: Font "Arial Narrow,normal,700" not found. Substituting with
> "any,normal,700".
> 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: Font "GTSuperDisplayLight,normal,700" not found. Substituting with
> "any,normal,700".
--
This message was sent by Atlassian Jira
(v8.20.7#820007)