Community
Participate
Working Groups
Build Identifier: Build id: 20110615-0604 The psoittionning of texts contained in svg files is not correct. In fact, it seems that birt doesn't take in account the flag style="dominant-baseline: text-before-edge" which indicate the positionning of the txt relatively to the position I will join the foolowing parts: 1/ p1.svg ( the svg to test) 2/ new_report_birt.pdf ( the result in birt) 3/ mozilla.jpg : the visu when mozilla opens the svg ( correct positionning) Reproducible: Always Steps to Reproduce: 1.Create a simple birt project 2.add an image 3.select p1.svg file ( set the dimensions in mm to see better) 4.generate the pdf file
Created attachment 201066 [details] svg file to import as an image
Created attachment 201067 [details] powitionning with birt
Created attachment 201068 [details] correct positionning with Mozilla
The issue is caused by the fact that the SVG feature set supported by Batik is limited. The following page shows what SVG features are supported: http://xmlgraphics.apache.org/batik/status.html As you can read the "dominant-baseline" attribute is not supported for "svg:text" elements and texts are displayed with "dominant-baseline=alphabetic". To overcome this issue, you would have to transform SVG files to replace "dominant-baseline=text-before-edge" by "dominant-baseline=alphabetic". Of course, you will have to recalculate coordinates of the text box to make the text appear at the same place. For that you will have to know the height of the font: yShift = font ascent
The following page describes how the "text-before-edge -> alphabetic" transformation could be performed: http://stackoverflow.com/questions/14461735/dominant-baselinetext-before-edge-equivalent-dy-transformation