Community
Participate
Working Groups
Build Identifier: Eclipse BIRT Designer Version 2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550> Hi, I have some problems with Hindi and Arabic fonts and I opened this bug for both. I am actually using BIRT 2.2.1 (but I can see partially the same problem in 2.2.2, 2.3, and the latest 2.5). I have developed a simple report with Hindi and Arabic characters (two simple labels). Let’s discuss the two issues separately. 1. Regarding the Hindi issue, exporting to PDF/PS simply never works. I know that the font managing changed a lot starting from BIRT 2.3 but still I got no luck with Hindi. Try to run the sample report. HTML is fine, while PDF/PS is always empty. 2. Regarding the Arabic fonts they work well for BIRT 2.3/2.5, while on the contrary I have a weird behaviour in BIRT 2.2.1/2.2.2. I had a look to the font configuration for BIRT 2.3/2.5 and a new fontConfig_pdf.xml has been added. Also, I can see that the genaral configuration for fonts is specified into the file fontConfig.xml and it's defined as follow: <composite-font name="all-fonts" default="Arial Unicode MS"> <font font-family="Times New Roman" catalog="Western" /> <font font-family="SimSun" catalog="Chinese" /> <font font-family="Batang" catalog="Korean" /> <font font-family="MS PMincho" catalog="Japanese" /> <font font-family="Tahoma" /> </composite-font> From what I understand, for sure Hindi/Arabic is not western, nor chinese, korean of japanese. So I think using the Tahoma font is ok for Hindi/Arabian. So, I edited the file (in BIRT 2.2.1) fontConfig_Windows_XP.xml and I uncommented the following lines: <block name="Arabic" range-start="0600" range-end="06ff" index="12" font-family="Tahoma"/> <block name="Arabic Supplement" range-start="0750" range-end="077f" index="14" font-family="Tahoma"/> <block name="Arabic Presentation Forms-A" range-start="fb50" range-end="fdff" index="117" font-family="Tahoma"/> <block name="Arabic Presentation Forms-B" range-start="fe70" range-end="feff" index="123" font-family="Tahoma"/> <block name="Devanagari" range-start="900" range-end="97f" index="17" font-family="Tahoma"/> As a proof we're speaking about the good range of characters, I have written a simple java program that prints the unicode representation of those two strings (Arabian/Hindi string) and this is the output (20 is the character for space, namely for each word separator) (Arabian HTML well displayed) 627,644,62F,648,644,629,20, 648,646,638,627,645,20, 627,644,62D,643 (Arabian PDF wrongly displayed) 627,644,62D,643,20, 648,646,638,627,645,20, 627,644,62F,648,644,629 (Hindi, doesn't show anything for PDF) 906,92A,915,94B,20, 92F,939,20, 938,902,926,947,936,20, 907,938,932,93F,90F,20, 92A,94D,930,93E,92A,94D,924,20, 939,941,906,20, 915,94D,92F,94B,902,915,93F,20, 906,92A,928,947 What I can see here is that the same Arabic string is well displayed in HTML, while in PDF is changing also in the bytes and I'm really not able understand why. Also, as you can see the Arabic characters are in the range <0x0600, ..., 0x06FF> so I picked up the good blocks (Arabic and Arabic Supplement). What it's strange is that setting Tahoma for Arabic and Arabic Supplement isn't enouth to have BIRT rendering them, I also need to set Tahoma for Arabic Presentation Forms-A and Arabic Presentation Forms-B. This is really strange, because these two blocks are defined for the unicode characters in range: <0xFE70, ..., 0xFEFF> and <0x0980, ..., 0x09FF> and my string doesn't contain at all these characters. What I'm asking: 1. is this a known issue for BIRT 2.2.1/2.2.2 (and the Hindi apply to the latest version of BIRt as well)? 2. is there a way to display Hindi fonts? 3. is there a way to have consistent Arabic fonts also for PDF/PS? 4. is it correct to use Tahoma fonts? (I guess the answer is is yes, since Arabic are working well for Tahoma fonts in BIRT 2.3/2.5). Thank you very much, Luca Reproducible: Always Steps to Reproduce: Just run the sample report and 1. export to HTML (works fine) 2. export to PDF (not consistent) For Hindi, it never works.
Created attachment 167719 [details] The sample report with Hindi and Arabic text.
The hindi character can't be displayed using Tahoma, you can use "Mangal". For example, in windows 7, you can add the statment in the fontConfigs.xml below <font font-family="Tahoma" />: <font font-family="Mangal"/> To decide which font should be used for the specific language, you can simply input the text into Word to see the font used for that text.
Hi, let me first of all thank you for this, I have never thought about this trick (to check with Word). After this, <block name="Arabic" range-start="0600" range-end="06ff" index="12" font-family="Times New Roman"/> <block name="Arabic Supplement" range-start="0750" range-end="077f" index="14" font-family="Times New Roman"/> <block name="Devanagari" range-start="900" range-end="97f" index="17" font-family="Mangal"/> <block name="Arabic Presentation Forms-A" range-start="fb50" range-end="fdff" index="117" font-family="Times New Roman"/> <block name="Arabic Presentation Forms-B" range-start="fe70" range-end="feff" index="123" font-family="Times New Roman"/> and magically all my fonts started working (for PS I have added those lines to fontConfig_postscript_linux.xml). You really should consider to add a section to BIRT documentation online regarding this trick. Regarding the arabian problem, I have only now noticed that - in HTML the arabian is well displayed, let's say the pattern is <A,B,...,Z>, - in PDF/PS the order is inverted: <Z,...,B,A>. If this is a limitation for BIRT 2.2.X, well, I don't think there's much to do. In such a case, you can close the defect. Again thank you. Luca