CairoSVG icon indicating copy to clipboard operation
CairoSVG copied to clipboard

em font-size text does not support inner element

Open Veknelyon opened this issue 7 years ago • 0 comments

This issue look related to #168.

When a <text> element with font-size specified in em contains inner element, conversion does not works properly.

Example:

<svg width="580" height="400" xmlns="http://www.w3.org/2000/svg">
 <g>
  <title>background</title>
  <rect fill="#fff" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
  <g display="none" overflow="visible" y="0" x="0" height="100%" width="100%" id="canvasGrid">
   <rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%"/>
  </g>
 </g>
 <g>
  <text x="50" y="100" font-family="Arial" font-size="5em">without tspan</text>
  <text x="50" y="200" font-family="Arial" font-size="5em"><tspan/>with tspan</text>
 </g>
</svg>

CairoSVG output: minimal_test

Expected (in Chromium): screenshot_2018-03-26_16-33-21

Veknelyon avatar Mar 26 '18 14:03 Veknelyon