| Summary: | Positionning of text contained in svg files is not correct | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | joel <joel.moreau> | ||||||||
| Component: | BIRT | Assignee: | Birt-ReportEngine-inbox <Birt-ReportEngine-inbox> | ||||||||
| Status: | NEW --- | QA Contact: | Maggie Shen <lshen> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | bluesoldier, vladk.dev | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows Vista | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
joel
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 |