how to install new fonts in jasperreports-Collection of common programming errors

I am using jasperreport with PHP. i have a problem with installing new fonts i had installed new fonts in jasper report by using the following steps.

  1. Edited jasperreports_extension.properties

    added the following line

net.sf.jasperreports.extension.simple.font.families.Mistral=net/sf/jasperreports/fonts/fonts.xml

  1. in net\sf\jasperreports\fonts\fonts.xml i added the following line

I am getting the following error

Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:JasperExportManager]]->exportReportToPdfFile((o:JasperPrint)[o:JasperPrint], (o:String)[o:String]). Cause: net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : Mistral pdfEncoding : Cp1252 isPdfEmbedded : false VM: 1.6.0_24@http://java.sun.com/" at: #-18 net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1961) #-17 net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1725) #-16 net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1694) #0 /mount1/imeddoc/dev/JasperReports/includes/javabridge.php(338): java_ThrowExceptionProxyFactory->getProxy(12, '@V', 'Could not load ...', true) #1 /mount1/imeddoc/dev/JasperReports/includes/javabridge.php(495): java_Arg->getResult(true) #2 /mount1/imeddoc/dev/JasperReports/includes/javabridge.php(501): java_Client->getWrappedResult(true) #3 /mount1/imeddoc/dev/JasperReports/includes/javabridge.php(705) in /mount1/imeddoc/dev/JasperReports/includes/javabridge.php on line 301 

can anyone help me to solve this issue please

  1. I solved it using the option in ireport. To install a new font in jasperreport , install that in ireport and Export to jar file and then replace the jar file in your jasper project. to install a font in ireport , go to tools -> options -> fonts and click on install fonts. follow the steps and you will now install new fonts in ireport. please dont forget to check embed this font in pdf.

    Now to export the fonts , go to tools -> options -> fonts and then from the list of availble fonts please select the fonts you needed and then click Export as extension . which wil export the fonts as jar file. now replace the jar file in jasperreport library .