I’m not sure I have a specific question, at this point. I have, as far as I can tell, followed the instructions meticulously, but I can’t get my fonts to print to a pdf generated by cfdocument.
Here’s what I’ve tried. If anyone can tell me what I’m missing, I would certainly appreciate it.
I downloaded the fonts.jar from Log in with Atlassian account, changed it to a zip, added my .ttf files, updated the pd4fonts.properties files, saved and renamed to fonts.jar.
I verified that the .ttf and .properties file in fonts.jar are in a subfolder named “fonts.”
Here’s a snippet from my pdf4fonts.properties file:
Monotype\ Corsiva=MTCORSVA.TTF
Century\ Gothic=GOTHICBI.TTF
I copied my fonts.jar to /opt/lucee/web/lib (This is a different path than what I’ve seen mentioned in other articles, but it appears to get loaded, according to application.log. I have, at various times, also tried putting my fonts.jar in /opt/lucee/lib, as mentioned in the links, above. But, that path didn’t exist in my lucee install, and I don’t see that fonts.jar get loaded, according to application.log)
After copying the fonts.jar file, I restarted Lucee. In fact, I restarted the whole Docker container.
I’m using the snippet, below, to test my custom font. Note that the Liberation Serif font, which is also included in fonts.jar, works as expected.
I’m really at a loss, here, so any and all suggestions are most welcome.
<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="inline; filename=./seatingReport.pdf">
<cfdocument format="PDF" marginbottom="0" marginleft="0" marginright="0" margintop="0"
orientation="landscape" overwrite="true" unit="in" localurl="true"
fontembed="true">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
@font-face {
font-family: "Monotype Corsiva";
}
@font-face {
font-family: "Century Gothic";
}
@font-face {
font-family: "Liberation Serif";
}
</style>
</head>
<body>
<div>
<span style="font-family:Monotype Corsiva;">Test</span><br />
<span style="font-family:Century Gothic;">Test</span><br />
<span style="font-family:Liberation Serif;">Liberation San</span>
</div>
</body>
</html>
</cfdocument>