Installing fonts in the PDF Export Language Support page returns with error of 'No font file could be found with the name'
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
According to the documentation Create a PDF in Another Language , Confluence administrators need to install font that supports non-latin characters before being able to export pages that contains non-latin characters to PDF successfully.
However, using the guide in the documentation above, installing fonts in the PDF Export Language Support page returns with error of 'No font file could be found with the name <font name>.ttf'
Screenshot 1: installing arial.ttf or verdana.ttf resulted with the above error
The following error message can be seen from atlassian-confluence.log as well:
2016-09-13 14:50:12,603 ERROR [http-nio-8090-exec-3] [extra.flyingpdf.config.ConfigurePDFLanguageSupportAction] execute Unable to install language font.
-- referer: http://myconfluence:8090/admin/flyingpdf/configurepdflanguagesupport.action | url: /admin/flyingpdf/doconfigurepdflanguagesupport.action | traceId: 8ec52da9b85d21c6 | userName: admin | action: doconfigurepdflanguagesupport
java.io.IOException: No font file could be found with the name Arial.ttf
at com.atlassian.confluence.extra.flyingpdf.config.FontsDirectoryFontDao.getFont(FontsDirectoryFontDao.java:25)
at com.atlassian.confluence.extra.flyingpdf.config.FontsDirectoryFontDao.removeFont(FontsDirectoryFontDao.java:55)
at com.atlassian.confluence.extra.flyingpdf.config.PdfExportFontManager.installFont(PdfExportFontManager.java:84)
...
Cause
From the logs, it seems like there's some issue with removing the old font.
Resolution
Resolution 1: Rename the font being installed to match those in the error message
For example: we're seeing the example error message from Screenshot 1, and at the same time trying to upload and install arial font with the file name "arial.ttf". Rename this file into "Arial.ttf" before re-uploading to Confluence.
Resolution 2: Reset the PDF font settings to its default setting manually
Should that does not fix the issue, delete the old font file from both database and filesystem manually before reinstalling the desired font.
- Shutdown Confluence
Run the following SQL query:
UPDATE bandana SET bandanavalue = '<map> <entry> <string>customfont</string> <string></string> </entry> </map>' WHERE bandanakey = 'com.atlassian.confluence.extra.flyingpdf.fontname';
- Delete anything in the
<confluence_home>/fonts
folder - Restart Confluence
- Upload and install the font again