Unicode Currency Symbols not rendering in BIRT pdf

shugarts
edited February 11, 2022 in Analytics #1
<p>Hi, we need help with getting the Costa Rican Colon, South Korea Won, Philippine Peso, and Indian Rupee currency symbols to display when running a BIRT pdf report. Within our .rptDesign we have 5 Text Items (HTML Dynamic Text) that contains a Unicode to display currency symbols. Out of the 5 currency symbols none of them display except for the Israeli Shekel (&#8362;). Please see the attachment for the list of currency symbols and unicodes.</p>
<p> </p>
<p>We are running BIRT 3.7.2 on Red Hat Enterprise Linux Server release 6.9 (Santiago). We have two rpm of fonts that are installed with tomcat rpm, msttcorefonts-2.5 and fonts-chinese-3.02.  The fonts have not been updated in long time, so we updated to the latest 2.6.1 version; <a data-ipb='nomediaparse' href='https://sourceforge.net/projects/mscorefonts2/files/'>https://sourceforge.net/projects/mscorefonts2/files/</a&gt; and rpm</p>
<p><span style="color:rgb(85,85,85);"><span style="font-size:10pt;"><a data-ipb='nomediaparse' href='https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm'>https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm</a></span></span></p&gt;
<p> </p>
<p>The font package that was installed (<a data-ipb='nomediaparse' href='http://corefonts.sourceforge.net/'>http://corefonts.sourceforge.net/</a&gt; 2.5.1) , BIRT font configuration</p>
<p> </p>
<p><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;">></span></span></span></p>
<p>       <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font-paths</span></span></span><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;">></span></span></span></p>
<p>        <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">path</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">path</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"/usr/share/fonts/msttcorefonts"</span></em> <span style="color:#008080;">/></span></p>
<p>              <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">path</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">path</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"/usr/share/fonts/default/Type1"</span></em> <span style="color:#008080;">/></span></p>
<p>       <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"></</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font-paths</span></span></span><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;">></span></span></span></p>
<p>       <span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;"><!--</span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">       Not All Chinese Characters Displaying in report</span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">              - Overriding the all-fonts BIRT report configuration to use Simplified Chinese (STSong-Light) </span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">                font encoding catalog instead of Traditional Chinese (MSung-Light). </span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">              - BIRT's default PDF font configuration is in <u>plugins</u>\org.eclipse.birt.report.engine.fonts\fontsConfig_pdf.xml</span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">              - BIRT bug (Bug 427672)</span></span></span></p>
<p><span style="color:#3f5fbf;"><span style="font-family:consolas;"><span style="font-size:10pt;">       --></span></span></span></p>
<p>       <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">composite-font</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">name</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"all-fonts"</span></em><span style="color:#008080;">></span></p>
<p>              <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">font-family</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"Times-Roman"</span></em> <span style="color:#7f007f;">catalog</span><span style="color:#000000;">=</span><em><span style="color:#2a00ff;">"Western"</span></em> <span style="color:#008080;">/></span></p>
<p>              <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">font-family</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"STSong-Light"</span></em> <span style="color:#7f007f;">catalog</span><span style="color:#000000;">=</span><em><span style="color:#2a00ff;">"Chinese"</span></em> <span style="color:#008080;">/></span></p>
<p>              <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">font-family</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"HeiseiKakuGo-W5"</span></em> <span style="color:#7f007f;">catalog</span><span style="color:#000000;">=</span><em><span style="color:#2a00ff;">"Japanese"</span></em> <span style="color:#008080;">/></span></p>
<p>              <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"><</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="font-family:consolas;"><span style="font-size:10pt;"> <span style="color:#7f007f;">font-family</span></span><span style="color:#000000;">=</span></span><em><span style="color:#2a00ff;">"HYGoThic-Medium"</span></em> <span style="color:#7f007f;">catalog</span><span style="color:#000000;">=</span><em><span style="color:#2a00ff;">"Korean"</span></em> <span style="color:#008080;">/></span></p>
<p>       <span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"></</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">composite-font</span></span></span><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;">></span></span></span></p>
<p><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;"></</span></span></span><span style="color:#3f7f7f;"><span style="font-family:consolas;"><span style="font-size:10pt;">font</span></span></span><span style="color:#008080;"><span style="font-family:consolas;"><span style="font-size:10pt;">></span></span></span></p>
<p> </p>
<p>The debugging we did like echo –e “<<Unicode>>” to confirm the character is available in OS, but not getting rendered in BIRT.</p>
<p> </p>
<p>Would anyone know why none of the symbols display except for Israeli Shekel (&#8362;) and how can we get the other currency symbols display when rendering the report in pdf? Thanks!</p>

Comments

  • <p>Can you attach a sample .rptdesign with those symbols?  What font is used in the .rptdesign?</p>
    <p> </p>
    <p>When you generate this report and view the report as PDF *from the Designer*, are you seeing the expected results?  What OS do you run the Designer on?</p>
    <p> </p>
    <p>Where did you modify the "fontsConfig.xml" file in your RHEL server environment?</p>
    <p> </p>
    <p>Can you attach the fontsConfig.xml you have in your server environment?</p>
    <p> </p>
    <p>Can you also attach the resulting PDF generated from your server environment?</p>
    Warning No formatter is installed for the format ipb
  • <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;">I have attached the .rptDesign file. You will see two grids and each grid will have 6 rows. The first row has a string column (data binding) to display the java source code values and the remaining 5 rows are dynamic text item (HTML) for each Unicode. The first grid uses Arial font and the second grid uses Times New Roman font.</span></p><p></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;"> </span></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;">When I generate the report and view the report as PDF *from the Designer*, I see all currency symbols for both the data binding and text items. Please see the attachment "</span><span style="font-size:10.5pt;font-family:Arial, sans-serif;">Preview from the BIRT Designer.pdf"</span><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;">. I'm running Windows 7 Enterprise.</span></p><p></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;"> </span></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;">However, when generating the report from the server environment only the Israeli Shekel currency symbol displays for both the data binding and text items in both fonts. Please see the attachment “Preview from the Server Environment.pdf”.</span></p><p></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;"> </span></p>
    <p style="margin:0in;"><span style="font-size:10.5pt;font-family:Arial, sans-serif;color:#282828;">I’m working on getting the information for the “fontsConfig.xml”.</span></p><p></p>
  • <p>We didn’t modify the default fontsConfig.xml found in BIRT Runtime JAR. Instead we specify the Font configuration when initializing BIRT ReportEngine. The following is the way we override the font configuration file. Please find the attached font config xml.</p>
    <p> </p>
    <p>Thanks.</p>
    <pre class="_prettyXprint">
    EngineConfig engineConfig = new EngineConfig();
                   
    String fontConfigPath = ReportingUtils.getFontsConfigFilePath();
    logger.info( String.format( "Fonts configuration file path: %s ", fontConfigPath ) );
    engineConfig.setFontConfig( new URL( fontConfigPath ) );
                   
    reportEngineFactory = (IReportEngineFactory)Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
    reportEngine = reportEngineFactory.createReportEngine( engineConfig );</pre>