We are using the CDK for our project and experimented with the new CDK 1.5.12 release and the depiction generator. However, we noticed a problem when generating SVGs for molecules:
The numbers in the SVG string seem to be localized according to the system environment. On systems with german language the numbers contain a comma instead of a dot, since in German you usually use a comma as decimal separator. This causes the generated SVG to not be readable by any other application.
If we set the JVM environment to English, the SVGs look fine. This is only a workaround, though, since we cannot guarantee that our program, which uses the depiction engine, is always run in an English environment.
To reproduce the behavior, just create an SVG string out of a valid AtomContainer with the following JVM argument:
-Duser.language=en
I suspect the problem is the class "SvgDrawVisitor". It uses "java.text.DecimalFormat" to produce nice formatted numbers, but this class uses the system localization by default.
Sorry, the JVM argument must be
-Duser.language=de
to generate "unreadable" SVGs.
Thanks for pointing this out, should be an easy fix.
John
Regards,
John W May
john.wilkinsonmay@gmail.com
On 11 December 2015 at 13:28, Sven Schrinner schrins@users.sf.net wrote:
Related
Bugs:
#1376Patched - https://github.com/cdk/cdk/pull/183