Fix bug preventing FOP from finding font directory

Change-Id: I944e2d59bc0430f3152c56ced70616b367d21cdb
Closes-Bug: #1300517
This commit is contained in:
David Cramer
2014-06-29 21:28:27 -05:00
parent 32bc779343
commit 30cc4b0fd5

View File

@@ -378,11 +378,11 @@ public abstract class PDFMojo extends AbstractFoMojo {
protected Configuration loadFOPConfig() throws MojoExecutionException {
System.out.println ("At load config");
File fontPath = (null != localFontPath && localFontPath != "")?new File(localFontPath):new File(getTargetDirectory().getParentFile(), "fonts");
StringTemplateGroup templateGroup = new StringTemplateGroup("fonts", fontPath.getAbsolutePath());
String fontPath = (null != localFontPath && localFontPath != "")? localFontPath: (new File(getTargetDirectory().getParentFile(), "fonts")).getAbsolutePath();
StringTemplateGroup templateGroup = new StringTemplateGroup("fonts", fontPath);
StringTemplate template = templateGroup.getInstanceOf("fontconfig");
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
template.setAttribute ("fontPath",fontPath.toURI().toString());
template.setAttribute ("fontPath",fontPath);
final String config = template.toString();
if (getLog().isDebugEnabled()) {
getLog().debug(config);