title: Jasper Report Character Encoding in PDF
body: <p>I am trying to use custom font in jasper report. <code>Myanmar3</code> is the standard font of Myanmar.
  Everything is ok, but <code>ReportTitle</code> must be <code>Myanmar Font</code> with <code>Myanmar3</code>. 
  <code>Google</code> also use <code>Myanmar3</code> for Myanmar locale.</p>
  
  <p>When export the report as <code>html</code> file. It can display report title, well.But, Exported <code>PDF</code> file cannot display incorrectly.</p>
  
  <p>In browser.</p>
  
  <p><img src="https://i.stack.imgur.com/XXcyz.png" alt="enter image description here"></p>
  
  <p>In PDF</p>
  
  <p><img src="https://i.stack.imgur.com/5xxdn.png" alt="enter image description here"></p>
  
  <pre><code>public void report() throws Exception {
      List&lt;SalesReport&gt; saleReports = salesReportService.findSalesReport(new SalesReportCriteria());
      InputStream inputStream = new FileInputStream("report-template/saleReportTemplate.jrxml");
      String outputFilePdf = "D:/temp/BasicReport.pdf";
      String outputFileHtml = "D:/temp/BasicReport.html";
      Map paramMap = new HashMap();
      paramMap.put("ReportTitle", "\u1005\u101B\u1004\u103A\u1038\u1021\u1004\u103A\u1038\u1019\u103B\u102C\u1038\u1011\u100A\u103A\u101E\u103D\u1004\u103A\u1038\u1001\u103C\u1004\u103A\u1038");
      paramMap.put("TableDataSource", new JRBeanCollectionDataSource(saleReports));
      JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
      JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, paramMap, new JRBeanCollectionDataSource(saleReports));
      JasperExportManager.exportReportToPdfFile(jasperPrint, outputFilePdf);
      JasperExportManager.exportReportToHtmlFile(jasperPrint, outputFileHtml);
  }
  </code></pre>
  
  <p>saleReportTemplate.jrxml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" 
                name="TableReport" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="802" 
                leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isFloatColumnFooter="true" whenResourceMissingType="Empty" uuid="a255c602-4ff1-4db8-ab72-65b5c3ff9bdd"&gt;
  
      &lt;property name="ireport.zoom" value="1.0"/&gt;
      &lt;property name="ireport.x" value="0"/&gt;
      &lt;property name="ireport.y" value="0"/&gt;
      &lt;style name="Myanmar3" isDefault="true" fontName="Myanmar3" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/&gt;
      &lt;style name="Table"&gt;
          &lt;box leftPadding="0"&gt;
              &lt;pen lineWidth="1.0" lineColor="#000000"/&gt;
          &lt;/box&gt;
      &lt;/style&gt;
      &lt;style name="TableHeader" mode="Opaque" backcolor="#808080"/&gt;
      &lt;style name="TableFooter" mode="Opaque" backcolor="#C0C0C0"/&gt;
      &lt;subDataset name="TableData" uuid="41cd3dac-2d22-41b9-9872-8fdb465d0f85"&gt;
          &lt;field ... for table generation/&gt;
      &lt;/subDataset&gt;
      &lt;parameter name="TableDataSource" class="net.sf.jasperreports.engine.JRDataSource"/&gt;
      &lt;parameter name="ReportTitle" class="java.lang.String" isForPrompting="false"/&gt;
      &lt;title&gt;
          &lt;band height="153"&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement uuid="b44cb7c1-f7d5-467c-8982-b95f65dcb849" x="106" y="0" width="573" height="59"/&gt;
                  &lt;textElement textAlignment="Center" verticalAlignment="Middle"&gt;
                      &lt;font size="22" isBold="true" isPdfEmbedded="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$P{ReportTitle}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;componentElement&gt;
                  --&gt;other tag for table....
              &lt;/componentElement&gt;
          &lt;/band&gt;
      &lt;/title&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>I already add <code>MYANMAR3.TTF</code> file and configure in <code>jasperreports-fonts-5.1.0.jar</code> for <code>myanmar3</code> font.</p>
  
  <p>jasperreports_extension.properties</p>
  
  <pre><code>net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.simple.font.families.dejavu=net/sf/jasperreports/fonts/fonts.xml
  net.sf.jasperreports.extension.simple.font.families.myanmar3=net/sf/jasperreports/fonts/fonts.xml
  </code></pre>
  
  <p>font.xml</p>
  
  <pre><code>...other default config.
  
  &lt;fontFamily name="Myanmar3"&gt;
      &lt;normal&gt;net/sf/jasperreports/fonts/myanmar3/MYANMAR3.TTF&lt;/normal&gt;
      &lt;bold&gt;net/sf/jasperreports/fonts/myanmar3/MYANMAR3.TTF&lt;/bold&gt;
      &lt;italic&gt;net/sf/jasperreports/fonts/myanmar3/MYANMAR3.TTF&lt;/italic&gt;
      &lt;boldItalic&gt;net/sf/jasperreports/fonts/myanmar3/MYANMAR3.TTF&lt;/boldItalic&gt;
      &lt;pdfEncoding&gt;Identity-H&lt;/pdfEncoding&gt;
      &lt;pdfEmbedded&gt;true&lt;/pdfEmbedded&gt;
  &lt;/fontFamily&gt;
  </code></pre>
  
  <p>I have tested so many configuration, reference and example. But, there is no effect on <code>PDF</code> file.</p>
  
  <p><strong>Let me know, if u have any suggestion and providing.</strong></p>