BIRT fontsConfig.xml font issue

2019-05-31 05:10发布

问题:

I working with BIRT 2.6 on a Unix machine, therefore I have problems to write a certain font.

I known I must edit the fontsConfig.xml file. But it didn't work: In short I have done this:

<fonts>
<font-aliases>
    <mapping name="Arial Narrow" font-family="LiberationSansNarrow-Regular" />
</font-aliases> 
<font-paths>
    <path path="/../../../fonts" />
</font-paths>
</fonts>

Is this configuration right? Is something missing/wrong?

At all there are four config xml's:

  • fontsConfig.xml

  • fontsCconfig_pdf.xml

  • fontsConfig_win32.xml

  • fontsConfig_linux.xml

Must I need to change all files, without the win32 file?

回答1:

There are three ways of handling the problem:

  1. Modify existing fontsConfig.xml ---To do this: follow the guidelines provided in the documentation of fontsConfig file. Also, in order to jar/unjar fontsConfig, follow this post : To Jar/Unjar fontsConfig.xml
  2. Create your new fontsConfig.xml and pick that from a specific location of your choice. ---To do this, you can call the engineConfig's setconfig and pass the full file path.

    config.setFontConfig(fontConfig files URL in file://abc/abc);

  3. Add fonts to your project path and pick that from the code using system properties. --- To do this, call the following.

    FontFactory.registerDirectory( scContext.getRealPath("full folder path") );

This should solve the problem



标签: unix fonts birt