xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerry <gerry.man...@telus.com>
Subject Configuring for Fonts included within a Spring-Boot/Camel Microservice
Date Wed, 09 Aug 2017 18:57:04 GMT
I'm using the Camel FOP Component version 2.19.1 which brings in the FOP 2.1
dependency.  The application must be self-contained - deployable as a fat
WAR. or JAR and Dockerized, or run within a Tomcat container.  I have the
fonts in the "resources" project folder which means Maven will place the
font files at the root of my classpath - directly under the /classes folder
within the WAR.

My FOP configuration file is loading correctly, and the fonts are found fine
if I just place my fonts in a local directory and hardcode the absolute path
to them like *embed-url="file:///C:/fonts/HelveticaNeueLTStd-Lt.ttf"*. 
However when I try a relative URL as in
*embed-url="HelveticaNeueLTStd-Lt.ttf"* an exception is thrown saying "*URI
is not absolute*".  This makes little sense, since the FOP documentation
states that a relative URI can be used and that's what the *<font-base>* is
for!  Very confusing...

I've tried a lot of things without success over the past few days, such as
even replacing "*file:*" in the URI with "*classpath:*", however unlike the
other Apache projects it seems to only support "*file:*".  I've even tried
removing my font registration from the config file completely, and just
using *<auto-detect />*.  While it finds all the fonts on my system (in
about 5 minutes!) it does not find the font at the root of my classpath. 
Additionally even if it did work, I'd prefer FOP not to scan every installed
system font and attempt to create TEMP cache files because this must be
deployable in Docker containers within a cloud environment. 

Is what I'm trying to do even possible with the current FOP implementation?

View this message in context: http://apache-fop.1065347.n5.nabble.com/Configuring-for-Fonts-included-within-a-Spring-Boot-Camel-Microservice-tp45367.html
Sent from the FOP - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message