Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362057 - Changing or mapping fonts using fontsConfig.xml became impossible in BIRT 3.7
Summary: Changing or mapping fonts using fontsConfig.xml became impossible in BIRT 3.7
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 critical with 4 votes (vote)
Target Milestone: 4.4.0   Edit
Assignee: Wei Yan CLA
QA Contact: Liwen Chen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 08:25 EDT by Taras Kopets CLA
Modified: 2018-09-27 04:11 EDT (History)
9 users (show)

See Also:


Attachments
report (2.91 KB, application/octet-stream)
2011-12-29 00:38 EST, Liwen Chen CLA
no flags Details
plain report design carrying greek utf text (2.93 KB, application/octet-stream)
2012-03-02 11:32 EST, Thanos Kyritsis CLA
no flags Details
fontconfig-greek-wrong.pdf (1.69 KB, application/pdf)
2012-03-02 11:33 EST, Thanos Kyritsis CLA
no flags Details
fontconfig-greek-wrong.png (15.85 KB, image/png)
2012-03-02 11:35 EST, Thanos Kyritsis CLA
no flags Details
fontconfig-greek-correct.pdf (21.69 KB, application/pdf)
2012-03-02 11:36 EST, Thanos Kyritsis CLA
no flags Details
fontconfig-greek-correct.png (15.89 KB, image/png)
2012-03-02 11:36 EST, Thanos Kyritsis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Taras Kopets CLA 2011-10-26 08:25:08 EDT
Build Identifier: 3.7.1.v20110913-1734

it is not possible to change font mapping after BIRT viewer deployment using fontsConfig.xml because all configs are bundled in org.eclipse.birt.runtime_VERSION-XXX.jar

Reproducible: Always
Comment 1 Taras Kopets CLA 2011-10-26 08:32:00 EDT
This seems to be critical because out of the box BIRT font configuration does not handle correct Cyrillic output in PDF.
Comment 2 Liwen Chen CLA 2011-12-29 00:37:45 EST
Hi Taras,

I tried to design a report:insert a label and set it as one Cyrillic font.
Then I deploy birt runtime into Tomcat6.
Run the report in pdf, the label shows the true type font effect.

I'm using 3.7.2 nightly build.

I will attach the report.

Please try if you can still reproduce it.
Comment 3 Liwen Chen CLA 2011-12-29 00:38:25 EST
Created attachment 208836 [details]
report
Comment 4 Xiaoying Gu CLA 2011-12-29 04:32:45 EST
Set as worksforme, if you still can reproduce it, please reopen it.
Thanks.
Comment 5 Xiaoying Gu CLA 2011-12-30 04:33:29 EST
the topic of the bug is - user cannot change default fontConfig configuration beacuse it is bundeled in JAR file.

Config file should not be put in a JAR file, it should be in a config folder or some kinds of places where user can edit it and save without any other effort.

Reopen it.
Comment 6 Thanos Kyritsis CLA 2012-03-02 11:31:10 EST
Good evening, I also acknowledge this bug, it is indeed very important for the users to edit the font configuration.

Apart from Cyrillic, Greek (utf8) is also not handled correctly by the default BIRT configuration. I'm used to applying the following changes to fontsConfig_pdf.xml for BIRT prior to 3.7.x in order to get correct Greek PDF output (sorry for going a bit offtopic): 

* change the mapping (i.e. Times New Roman for serif and Arial for sans-serif, or some free proper truetype unicode font, such as DejaVu, Bitstream Vera, etc)

* comment out all font families (Chinese, Korean, Japanese) except Western, inside the composite-font option.

I've tested this on Linux, Windows and OSX enviroments, mainly using JBoss and BIRT runtime WebApp. I don't know why commenting out Asian families is required but if I don't do, something goes wrong with the PDF font embedding and no fonts gets embedded on the PDF, which is wrong.

However, point is, we do need to access fontConfig_pdf.xml and modify it for several reasons. Another good example is for using msttcorefonts in a Linux environment, these fonts are not in a standard path, but usually something like /usr/share/fonts/truetype/msttcorefonts.

I'm going to attach evidence for the above showcase, just to emphasize that the majority of non-Latin BIRT users will indeed need to modify fonts configuration at some point. I'll attach the same report attached by Liwen Chen, I've only added some Greek utf8 text under it. I'll also attach both PDFs, the wrong one from a vanilla BIRT 3.7.2 runtime environment (running in jboss 4.2.3) and the correct one using the BIRT 2.6.2 environment with customized font configuration. I'll also attach screenshots just in case.

Sorry for the long post and thanks in advance for your attention.
Comment 7 Thanos Kyritsis CLA 2012-03-02 11:32:20 EST
Created attachment 211983 [details]
plain report design carrying greek utf text
Comment 8 Thanos Kyritsis CLA 2012-03-02 11:33:59 EST
Created attachment 211984 [details]
fontconfig-greek-wrong.pdf

Wrong PDF file (and font embedding) generated by vanilla BIRT 3.7.2
Comment 9 Thanos Kyritsis CLA 2012-03-02 11:35:30 EST
Created attachment 211985 [details]
fontconfig-greek-wrong.png

Screenshot from 3.7.2 faulty greek pdf font embedding
Comment 10 Thanos Kyritsis CLA 2012-03-02 11:36:13 EST
Created attachment 211987 [details]
fontconfig-greek-correct.pdf

Correct PDF containing Greek text generated by BIRT 2.6.2 and customized font config
Comment 11 Thanos Kyritsis CLA 2012-03-02 11:36:55 EST
Created attachment 211989 [details]
fontconfig-greek-correct.png

Screenshot from Correct PDF containing Greek text generated by BIRT 2.6.2 and customized font config
Comment 12 Taras Kopets CLA 2012-07-09 07:26:56 EDT
To edit fontConfig users have to repackage the org.eclipse.birt.runtime_*.jar after each release.

Is it possible to put these configuration files in easily editable place?
Comment 13 Zhiqiang Qian CLA 2014-07-28 18:27:43 EDT
Mark as fixed. see commit fa7c442ffc8f3a851124892d845030aea66fd10e. EngineConfig now has a setFontConfig() method to specify the extra font directory.
Comment 14 Thanos Kyritsis CLA 2014-07-29 04:15:46 EDT
It surely is not fixed. The bug is not about adding another font directory, it is about modifying the whole mapping and/or the whole font configuration.
Comment 15 Wei Yan CLA 2014-07-29 12:32:05 EDT
setFontConfig is used to override system font configuration. For example:


config.setFontConfig(new File("d:/config/font.xml").toURL());
Comment 16 Taras Kopets CLA 2014-08-12 14:52:25 EDT
>> setFontConfig is used to override system font configuration. For example:
>> config.setFontConfig(new File("d:/config/font.xml").toURL());

This is really great if now there is ability to change the font config location in packaged BIRT Viewer!

Can you please tell me where I have to put above mentioned line of code in packaged version of BIRT viewer in order to change location of config file?
Comment 17 Taras Kopets CLA 2014-08-15 07:21:24 EDT
Reopening this bug as there is still no ability to change font mapping/configuration in BIRT Viewer.
Comment 18 jeevan dinesh CLA 2018-08-14 03:02:59 EDT
When viewing Birt report from UI, we can see the barcode. But when try to view in PDF, the barcode will say "The resource of this report item is not reachable" when the protocol is https, but its working fine when its http
Comment 19 Kamal Bansal CLA 2018-09-27 04:11:29 EDT
is this resolved?