Community
Participate
Working Groups
Build Identifier: 2.6.2 Currently adding fonts from a custom directory is a nuisance since you have to modify the config-xml in the fonts plugin or put those fonts into the jre/lib/fonts directory. A simple SystemProperty which would accept a commaseparated list of custom font directories would be a big plus. Reproducible: Always
I helped myself with a SystemProperty which is used to inject one custom directory in the FontMappingManagerFactory.java That way i do not need to edit a file inside the plugin directory. ------------------------------------- private void registerJavaFonts( ) { AccessController.doPrivileged( new PrivilegedAction<Object>( ) { public Object run( ) { String javaHome = System.getProperty( "java.home" ); String fontsFolder = javaHome + File.separatorChar + "lib" + File.separatorChar + "fonts"; FontFactory.registerDirectory( fontsFolder ); // Register custom font directory String customFontsDir = System.getProperty("birt.customfontsdir"); if(customFontsDir != null){ FontFactory.registerDirectory(customFontsDir); } return null; } } ); } ---------------------
Birt loads fonts automatically from the default system font folder. You can find the font paths in <font-paths> section of fontsConfig.xml, and simply copy the font files into the system font folder to avoid any configurations. However, adding custom font directories from System property is a good alternative way. Now you can use "birt.font.dirs" as the key. It will accept a list separated by File.pathSeparator( On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'. ) Each path in the list can be a font directory or a single font file. Fixed.
reopen
Now Engine uses EngineConfig.setFontConfig(URL) to specify a user defined font config file path.
Is this system property working? birt.font.dirs It does not appear in the code.
Is it possible to set some configuration option of fontsConfig*.xml files location? Currently users of BIRT have to repackage jar file to edit fontConfig, which also means removal of jar signature.
The font configuration plugin(org.eclipse.birt.report.engine.fonts_*) is already a folder now. The end user need not repackage the jar file.
I've just downloaded BIRT runtime and was hoping to see a separate folder for fonts config and was disappointed - there is no such folder. Currently we have to repackage this jar file: birt-runtime*\WebViewerExample\WEB-INF\lib\org.eclipse.birt.runtime*.jar in order to change the fonts configuration. It would be great if there is an easy way to do this. I'd say this bug is still open if there is no such easy way to specify fonts. I'd also consider this bug as severe as out of the box (default configuration) of BIRT does not produce correct cyrillic PDFs (all the letters are missing)!
(In reply to comment #8) > I've just downloaded BIRT runtime and was hoping to see a separate folder > for fonts config and was disappointed - there is no such folder. > > Currently we have to repackage this jar file: > birt-runtime*\WebViewerExample\WEB-INF\lib\org.eclipse.birt.runtime*.jar > in order to change the fonts configuration. > > It would be great if there is an easy way to do this. > > I'd say this bug is still open if there is no such easy way to specify fonts. > I'd also consider this bug as severe as out of the box (default > configuration) of BIRT does not produce correct cyrillic PDFs (all the > letters are missing)! Can you use the osgi-runtime which is also provided on the download site? The font config plugin is shipped as dir in the plugins/ folder.
Thank you very much! That's exactly what I was looking for!
(In reply to comment #5) > Is this system property working? > birt.font.dirs > > It does not appear in the code. "birt.font.dirs" is removed since we uses EngineConfig.setFontConfig(URL) to specify a user defined font config file path now.
Are there plans to add the fonts directory to the POJO runtime?
(In reply to comment #9) > (In reply to comment #8) > > I've just downloaded BIRT runtime and was hoping to see a separate folder > > for fonts config and was disappointed - there is no such folder. > > > > Currently we have to repackage this jar file: > > birt-runtime*\WebViewerExample\WEB-INF\lib\org.eclipse.birt.runtime*.jar > > in order to change the fonts configuration. > > > > It would be great if there is an easy way to do this. > > > > I'd say this bug is still open if there is no such easy way to specify fonts. > > I'd also consider this bug as severe as out of the box (default > > configuration) of BIRT does not produce correct cyrillic PDFs (all the > > letters are missing)! > > Can you use the osgi-runtime which is also provided on the download site? > The font config plugin is shipped as dir in the plugins/ folder. Hi! I'm also having issues with PDF export of reports. Fonts used in PDF are wrong. Googling I stumbled onto this page and after reading comments I deployed birt.war from osgi-runtime onto my tomcat installation and then added a new path in fontsConfig_pdf.xml on this path: /opt/tomcat/webapps/birt/WEB-INF/platform/plugins/org.eclipse.birt.report.engine.fonts_4.2.1.v20120820/ then I restarted the Tomcat and... still no go :( Can You point me to the right direction please? BTW, Tomcat is running on Centos 5.5.
Hi Misel! I solved the problems with pdf fonts this way: 1. renamed (removed) fontsConfig_pdf.xml 2. edited fontsConfig_linux.xml so it points to some real font, like this: <?xml version="1.0" encoding="UTF-8"?> <font> <font-aliases> <mapping name="serif" font-family="Bitstream Vera Serif" /> <mapping name="sans-serif" font-family="Bitstream Vera Sans" /> <mapping name="monospace" font-family="Bitstream Vera Sans Mono" /> <mapping name="cursive" font-family="Bitstream Vera Sans Mono" /> <mapping name="fantasy" font-family="Bitstream Vera Sans Mono" /> </font-aliases> <composite-font name="all-fonts" default="Bitstream Vera Sans Mono"> <font font-family="Bitstream Vera Sans Mono" catalog="Western" /> <font font-family="ZYSong18030" catalog="Chinese" /> <font font-family="Baekmuk Batang" catalog="Korean" /> <font font-family="Kochi Mincho" catalog="Japanese" /> </composite-font> </font> 3. make sure the font you listed in fontsConfig_linux.xml is accessible using one of the paths in <font-paths> listing of main fontsConfig.xml, if not, add the dirrectory of this font to the list.
(In reply to comment #14) > Hi Misel! > > I solved the problems with pdf fonts this way: > 1. renamed (removed) fontsConfig_pdf.xml > 2. edited fontsConfig_linux.xml so it points to some real font, like this: Hi Taras, I managed to get it to work but the key component was to change the encoding for Arial font family to Cp1250. I found that info here: http://goo.gl/dXT5u Before I tried with UTF-8 but that didn't work. Thanks for the help!