[Java] Bullet and text position in SVG output


#1

When text is in placed inside a block and formatted using text block margins or paragraph indents, there are some text positioning issues:

  1. Text is vertically too high, so it overlaps the block boundary
  2. There is too much spacing between the bullet character and the associated text
  3. When paragraph indenting is used, it bleeds into the bullet list, which is different from how Visio deals with the indentation

Attached is a zip containing:

  1. indents-and-margins.vsdx - source Visio
  2. indents-and-margins.svg - SVG saved from Visio
  3. indents-and-margins.svg - SVG created with Diagram 18.3

The diagram contains 3 blocks, one with no margins/indent, one with text block margins and one with paragraph indent.

All three blocks show the incorrect vertical spacing of text and spacing between bullet point and text.

The block with paragraph indents shows the bullets in the wrong position.

Looking at the output SVG, Visio creates the bullet elements within a single <text> block, as a series of <tspans> broken up by <newlineChar> elements. Aspose is currently creating all the parts of the bullet list as individual <text> elements. Visio also outputs the bullet point as unicode ‘MIDDLE DOT’ (U+00B7) while Aspose is outputting U+F06C which works for Wingdings, but isn’t portable. It would be preferable to use the Unicode character for portability.

bullets-and-indents.zip (13.4 KB)

Thanks
Vittal


#2

@vittala,

We managed to replicate the said problem in our environment. It has been logged under the ticket ID DIAGRAMNET-51446 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.


#3

Thanks @imran.rafique

One of the things to also consider is, when creating an SVG text block containing a list, it might be nice to add a css class attribute to the text block so that it’s identified as a list. Then the SVG list text can be styled more easily. At the moment, it’s not possible to identify list text.

Regards
Vittal


#4

@vittala,

We have logged an enhancement ticket ID DIAGRAMNET-51447 in our issue tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.


#5

The issues you have found earlier (filed as DIAGRAMNET-51446) have been fixed in Aspose.Diagram for .NET 19.6.


#6

Hi
Will this also be fixed for Java?

Thanks
Vittal


#7

@vittala

Yes, the fix against this issue has also been ported into Java API. In case you face any issue, please feel free to let us know.