By default, the Specify Report Runner Service has only a few fonts built-in (SansSerif, Serif, and Monospaced). To add additional fonts, you will need to add a font extension jar, which is a Java file that contains font files that can be made available for the Report Runner Service
If upon running a report you’ve developed you see an error like the following, it means you need to either use a supported font or add an additional font to your font extension jar file:
JRFontNotFoundException: Font "DejaVu Sans" is not available to the JVM. See the Javadoc for more details.
Fortunately, this is realtively simple, and only requires the use of Jaspersoft Studio which is already required for developing reports and labels in Specify 7.
These screenshots were taken while using Jaspersoft Studio 6.21.3
-
Navigate to Settings… in the Jaspersoft Studio menu bar
-
Search “font” and/or navigate to ‘Jaspersoft Studio → Fonts’ in the sidebar
-
You can add fonts to the font extension jar file via the “Add” buttons in this menu. In most cases, you can click “Add From Path” and select a directory on your computer that contains TrueType (.ttf) font files.
For example, I have a folder named “fonts-main” which contains all of the fonts I want to include in my jar file. Click Open.
Next, click Finish to confirm the path to your fonts.
Jaspersoft Studio will analyze each font and add it to the list.
-
Once the fonts have been added to the list, highlight all fonts (which can be done by clicking any font and pressing Ctrl + A
-
Save the
.jarfile to a local directory -
Copy the
.jarfile to the server running the Specify Report Runner Service. -
Bind the
.jarfile (in this example,report-fonts.jar) into the container’s Jetty webapp libs.docker run \ -p XXX.XX.XX.XX:8080:8080 \ --name report-runner \ -d \ -v /home/ubuntu/report-runner-service/report-fonts.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/report-fonts.jar \ -v /home/ubuntu/report-runner-service/src/main/webapp/WEB-INF/lib/barcode4j-2.2.4.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/barcode4j-2.2.4.jar \ sp7cloud-report-runnerYou can bind additional font JAR bundles (e.g.
PTSerif.jar) as well (docker-compose example):report-runner: restart: unless-stopped image: specifyconsortium/report-runner volumes: - './report-fonts.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/report-fonts.jar:ro' - './PTSerif.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/PTSerif.jar:ro'







