domenic / svg2png

Converts SVGs to PNGs, using PhantomJS
Other
585 stars 134 forks source link

problem with using RTL text that contains number #91

Open mghayour opened 7 years ago

mghayour commented 7 years ago

hi thank you for your awesome project i test it for some big design and it worked correctly except on some text

when we combine RTL text (persian used here) with some numeric parts, numbers dosent show correctly (see below example)

test Svg :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="500px" height="150px" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 500 150"
 xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <style type="text/css">
   <![CDATA[
    .fil1 {fill:#ff0000}
    .fnt0 {font-weight:normal;font-size:65px;font-family:'Arial'}
   ]]>
  </style>
 </defs>
  <text x="480" y="100" class="fil1 fnt0" style="direction:rtl;" text-anchor="strat">1 ساعت و 30 دقیقه</text>
</svg>

svg2png result (notice to "30" and "1") texttest

excepted result (shot taken when open this svg in chrome) image

thank you