Specify Report Runner Fonts

By default, the Specify Report Runner works with the following fonts:

  • SansSerif
  • Serif
  • Monospaced

If the report runner service lacks a report’s fonts, it will use built-in PDF fonts, which may lead to appearance discrepancies or text overflow issues.

To provide fonts, add a font extension jar to src/main/webapp/WEB-INF/lib/ before compiling.

Adding Fonts

Specify Cloud users already have access to these fonts!

:warning: If you are self-hosting Specify at your institution, please pass these instructions along to your IT administrator as this involves server configuration.

For full compatibility with existing Specify reports or to extend the range of supported fonts, you can install this jar file in your report runner.

Download: report-fonts.jar

Included Fonts:

  • Arial
  • SansSerif
  • Arial Narrow
  • Calibri
  • Copperplate Gothic Light
  • Baskerville Old Face
  • Franklin Gothic Demi Cond
  • Garamond
  • Georgia
  • Lucida Fax
  • Lucida Sans
  • Palatino Linotype
  • Times New Roman
  • Trebuchet MS
  • Verdana

  • Detailed instructions on creating the font extension file are available at JavaSkeleton. Include variants (italic, bold, etc.) for each font following the iReport instructions.
  • When using a Docker container, mount the font extension jar into the container by specifying a volume directive:
    docker run -p 8080 --name report-runner -d -v ./report-fonts.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/report- fonts.jar specifyconsortium/report-runner
    

Font Availability Issues

If encountering font availability problems in reports or labels, you may see a “JRFontNotFoundException” error. Make sure required fonts are included by following the instructions above.

Error Example:

HTTP ERROR 500 net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "DejaVu Sans" is not available to the JVM. See the Javadoc for more details.

Additional Resources

  • Refer to the fonts section on GitHub for more information about handling fonts.

I am slightly confused by these instructions. I am trying this out in our new setup in docker, but unsure how to add these fonts to the running container.

  • Do I really need to create a font extension file in this case?
  • If so, isn’t there one readily made for all the fonts listed here?
  • I can’t do the “run” command because the report runner container is already running as set up in the docker compose file
  • How to add the volume directive to the docker compose file then?
docker: Error response from daemon: Conflict. The container name "/report-runner" is already in use by container "1bdd09ec11c6b6fbfe17f72b8040336cbae58fd2cc7e731955868473744c9162". You have to remove (or rename) that container to be able to reuse that name.

OK I got it to work in the docker.compose.yml like so:

  report-runner:
    restart: unless-stopped
    image: docker.io/specifyconsortium/report-runner

    volumes:
      - "./report-fonts.jar:/var/lib/jetty/webapps/ROOT/WEB-INF/lib/report-fonts.jar"