[prev in list] [next in list] [prev in thread] [next in thread]
List: batik-users
Subject: Re: Text rendering of some Persian characters has issues when converting SVG to PNG
From: Mostafa Mahdieh <m.mahdieh () gmail ! com>
Date: 2013-06-28 18:33:22
Message-ID: CAKE99RJU+CKvaMgdd7xav14VqhYCqUR8-qd+YKoRQzo5YFjBJA () mail ! gmail ! com
[Download RAW message or body]
Does anyone see my messages? Am I sending to the wrong group?
On Wed, Jun 26, 2013 at 11:53 PM, Mostafa Mahdieh <m.mahdieh@gmail.com>wrote:
> Any ideas?
>
>
> On Mon, Jun 24, 2013 at 5:33 PM, Mostafa Mahdieh <m.mahdieh@gmail.com>wrote:
>
>> Hi,
>>
>> I am using Activiti Explorer 5.12.1, which uses batik transcoder 1.7 as a
>> library. When exporting bpmn models to png using Activiti Explorer, the
>> output has issues on characters "ی", "ک", "پ" and "گ". Note that theses
>> characters are part of the Persian character set of utf-8, and other
>> characters which are in the common set of Arabic and Persian character
>> sets, don't seem to have any problems.
>>
>> I have *attached* a sample of one of my tests. The text in the box
>> should read
>>
>> "ما کب گپ جیب جوب پا"
>>
>> which is incorrectly shown as
>>
>> "ما کب گپ جیب جوب پا"
>>
>> I traced the problem in Activiti Explorer code to this small code snippet:
>>
>> =======================
>> InputStream svgStream = new
>> ByteArrayInputStream(modelForm.getFirstValue("svg_xml").getBytes("utf-8"));
>> TranscoderInput input = new TranscoderInput(svgStream);
>>
>> PNGTranscoder transcoder = new PNGTranscoder();
>> // Setup output
>> ByteArrayOutputStream outStream = new ByteArrayOutputStream();
>> TranscoderOutput output = new TranscoderOutput(outStream);
>>
>> // Do the transformation
>> transcoder.transcode(input, output);
>> final byte[] result = outStream.toByteArray();
>> =======================
>>
>> It seems that the issues are coming from the PNGTranscoder not being able
>> to render persian text correctly. PNGTranscoder is part of Apache Batik
>> (org.apache.batik.transcoder.image.PNGTranscoder).
>>
>> I have also created a very small eclipse project which does the same
>> thing, independent of any Activiti Explorer code, which helps a lot to
>> debug the problem. The project is attached.
>>
>> More details:
>>
>> OS: Ubuntu Linux 12.04 (3.2.0-44-generic #69-Ubuntu SMP Thu May 16
>> 17:35:01 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux)
>>
>> Java: java version "1.7.0_21"
>> OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.04.1)
>>
>> Batik version used by Activiti Explorer (found in the MANIFEST.MF of the
>> jar file included): 1.7+r608262
>>
>> Regards
>> --
>> Mostafa Mahdieh
>>
>
>
>
> --
> Mostafa Mahdieh
>
--
Mostafa Mahdieh
[Attachment #3 (text/html)]
<div dir="ltr"><div style>Does anyone see my messages? Am I sending to the wrong \
group?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, \
Jun 26, 2013 at 11:53 PM, Mostafa Mahdieh <span dir="ltr"><<a \
href="mailto:m.mahdieh@gmail.com" target="_blank">m.mahdieh@gmail.com</a>></span> \
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Any ideas?</div><div \
class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Mon, Jun \
24, 2013 at 5:33 PM, Mostafa Mahdieh <span dir="ltr"><<a \
href="mailto:m.mahdieh@gmail.com" target="_blank">m.mahdieh@gmail.com</a>></span> \
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am using Activiti \
Explorer 5.12.1, which uses batik transcoder 1.7 as a library. When exporting bpmn \
models to png using Activiti Explorer, the output has issues on characters \
"ی", "ک", "پ" and "گ". Note that theses \
characters are part of the Persian character set of utf-8, and other characters which \
are in the common set of Arabic and Persian character sets, don't seem to have \
any problems.</div>
<div><br></div><div>I have <b>attached</b> a sample of one of my tests. The text in \
the box should read</div><div><br></div><div>"ما کب گپ جیب جوب \
پا"</div><div><br></div><div>which is incorrectly shown as</div>
<div><br></div><div>"ما کب گپ جیب جوب \
پا"</div><div><br></div><div>I traced the problem in Activiti Explorer code \
to this small code snippet:</div><div><br></div><div>=======================</div> \
<div><div> InputStream svgStream = new \
ByteArrayInputStream(modelForm.getFirstValue("svg_xml").getBytes("utf-8"));</div><div> \
TranscoderInput input = new TranscoderInput(svgStream);</div><div>
</div><div> PNGTranscoder transcoder = new \
PNGTranscoder();</div><div> // Setup output</div><div> \
ByteArrayOutputStream outStream = new ByteArrayOutputStream();</div><div> \
TranscoderOutput output = new TranscoderOutput(outStream);</div>
<div> </div><div> // Do the transformation</div><div> \
transcoder.transcode(input, output);</div><div> final byte[] result = \
outStream.toByteArray();</div><div><div>=======================<br></div><div>
<br></div><div>It seems that the issues are coming from the PNGTranscoder not being \
able to render persian text correctly. PNGTranscoder is part of Apache Batik \
(org.apache.batik.transcoder.image.PNGTranscoder).</div> <div><br></div><div><div>I \
have also created a very small eclipse project which does the same thing, independent \
of any Activiti Explorer code, which helps a lot to debug the problem. The project is \
attached.</div> </div><div><br></div><div>More details:</div><div><br></div><div>OS: \
Ubuntu Linux 12.04 (3.2.0-44-generic #69-Ubuntu SMP Thu May 16 17:35:01 UTC 2013 \
x86_64 x86_64 x86_64 GNU/Linux)</div><div> <br></div><div>Java: java version \
"1.7.0_21"</div><div>OpenJDK Runtime Environment (IcedTea 2.3.9) \
(7u21-2.3.9-0ubuntu0.12.04.1)</div><div><br></div><div>Batik version used by Activiti \
Explorer (found in the MANIFEST.MF of the jar file included): 1.7+r608262</div>
<div><br></div><div>Regards</div><span><font color="#888888">-- <br><div \
dir="ltr"><div style="text-align:left">Mostafa Mahdieh</div></div> \
</font></span></div></div></div> </blockquote></div><br><br \
clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- \
<br><div dir="ltr"><div style="text-align:left">Mostafa Mahdieh</div></div> \
</font></span></div> </blockquote></div><br><br clear="all"><div><br></div>-- \
<br><div dir="ltr"><div style="text-align:left">Mostafa Mahdieh</div></div> </div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic