Strange behaviour when rendering SVG texts under java program vs jruby

Urmo Rae <[email protected]> Tue, 19 Jan 2016 11:39:53 +0200
Newsgroups gmane.text.xml.batik.user
Message-ID <CALkmqZUt_Ppp0iWX3GZq0Vs7z1x+mJkdax-C8TD-jwCz_cXvmg@mail.gmail.com>
​Hi,

​I've got rather curious case when using Batik to render SVG texts to PDF.
If following code runs inside plain java program, everything works fine:

public byte[] convert(String svg) throws TranscoderException,
java.io.IOException {
    ByteArrayInputStream instream = new
ByteArrayInputStream(svg.getBytes(StandardCharsets.UTF_8));
    ByteArrayOutputStream outstream = new ByteArrayOutputStream(50 * 1024);

    TranscoderInput input = new TranscoderInput(instream);
    TranscoderOutput output = new TranscoderOutput(outstream);

    Transcoder transcoder = new PDFTranscoder();
    transcoder.transcode(input, output);

    return outstream.toByteArray();
}

However, if same code is called from JRuby 1.7 (same ui-less Linux machine,
using same Oracle 1.8.0_66 64 bit JVM), all texts in SVG are rendered with
a box around each character. To verify it's not ruby-2-java issue, I've
also tried completely isolated method where java code reads in the svg file
and outputs PDF to a file - the issue still remains so there must be
something different how the JVM acts while running jruby. Any ideas what
might cause it?

Urmo