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 https://luceeserver.atlassian.net/browse/LDEV-12732, 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:
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.
<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"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
font-family: "Monotype Corsiva";
font-family: "Century Gothic";
font-family: "Liberation Serif";
<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>