luigiw Posted September 10, 2019 Share Posted September 10, 2019 I am experiencing an unusual problem involving custom fonts not displaying in reports run on JasperReports Server. I followed the instructions here https://community.jaspersoft.com/wiki/custom-font-font-extension. My custom fonts display correctly when I run the report in Jaspersoft Studio. However when I upload the report to my local instance of Jasperserver, the report defaults to using Helvetica font. I also get a decoding error in the console. If I run it in Chrome, I get "Failed to decode downloaded font". If I use Firefox I get "downloadable font: rejected by sanitizer". The custom font also fails to render in Safari.I have repeated the protocol found at https://community.jaspersoft.com/wiki/custom-font-font-extension with 3 custom fonts. , All 3 passed validation using Mac's Font Book, so as far as I can tell the fonts are not corrupted.I am running Jasperserver 6.2.0 on a 2017 MacBook Pro running OS 10.13.6. I am using Jaspersoft Studio 6.2.0.The browsers I have tried this on are Chrome (77.0.3865.75), Firefox (52.7.3), and Safari (12.1.2) Link to comment Share on other sites More sharing options...
joseng62 Posted September 12, 2019 Share Posted September 12, 2019 So you exported a FONTNAME.jar from jasperstudio and then you deployed the jar into webappsjasperserverWEB-INFlib and restarted the apache server ? Then in the jrxml you have the font set for each element to correct font?You can also decompile that jar via jd-gui to see what is the logic inside the jar. Also when creating the jar in jasperstudio, set the PDF Encoding to "Identity-H (Unicode with horizontal writing)"Hope this all helps, good luck! Link to comment Share on other sites More sharing options...
luigiw Posted September 12, 2019 Author Share Posted September 12, 2019 Thanks joseng62. Your suggestion of seting the PDF Encoding to "Identity-H (Unicode with horizontal writing)" fixed the problem in the html display of the report in the Jasperserver UI. However, strangely, now when I try to export the fiile into a PDF format, the PDF doesn't display the custom font. Is it possible to have the custom font display in both the html rendering and in an exported PDF? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now