BIRT: pdf emitter, load/use fonts from relative path or from jar files

前端 未结 2 579
心在旅途
心在旅途 2021-01-13 05:51

I use BIRT since early days and still have riddles regarding PDF emitter.

Short story: Can I configure fontsConfig.xml to load fonts from relative

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 06:18

    With some BIRT versions, you can use a SystemProperty "birt.font.dirs". This overrides the fontsConfig.xml.

    Well, this once worked, but obviously it was removed from the BIRT source code later.

    Now you can call something like

    EngineConfig engineConfig = new EngineConfig();
    URL fontsConfigurationURL = new URL("file:///path/to/my/fontsConfig.xml");
    engineConfig.setFontConfig(fontsConfigurationURL);
    
    Platform.startup(engineConfig);
    

    This allows you to supply BIRT with a customized version of fontsConfig.xml without poking around in the JARs.

    Tested with BIRT 4.3.0.

提交回复
热议问题