w3c / svgwg

SVG Working Group specifications
Other
710 stars 133 forks source link

SVG2 text example uses text-align:justified #791

Open joneuhauser opened 4 years ago

joneuhauser commented 4 years ago

https://www.w3.org/TR/SVG2/text.html#TextShapePadding contains an example:

<svg xmlns="http://www.w3.org/2000/svg"
     width="300" height="300" viewBox="0 0 300 300">

  <circle id="circle" cx="150" cy="150" r="125" fill="none" stroke="black"/>
  <text style="shape-inside: url(#circle);
           shape-padding: 25px;
           font: 18px DejaVu Sans;
           text-align: justified;
           line-height: 110%;">This is an
  example of wrapped text in SVG 2! There should
  be 25 pixel padding around the text. The text is
  justified on both sides. It looks good!</text>

</svg>

I have never seen text-align: justified before. According to CSS3, it should be justify: https://drafts.csswg.org/css-text-3/#text-align-property

(also in CSS 2: https://www.w3.org/TR/CSS2/text.html#alignment-prop)

vanthome commented 1 month ago

This is still wrong. I cannot understand why this hasn't been fixed.

Crissov commented 1 month ago

It’s because nobody is working on the SVG specification anymore.

vanthome commented 1 month ago

Somis SVG 2 dead?

joneuhauser commented 1 month ago

This is our working assumption at Inkscape. New features are added de-facto by updates to the referenced modules, such as new CSS selectors, CSS Color Level 4, etc, and we try our best to support them.

The features we need to provide editability (non destructive editing, advanced text editing, multipage, export hints, swatches, ...) we've reluctantly decided to create in our own XML namespace, and we offer export to SVG 1.1. In light of the SVGWG's inactivity, this divergence will grow over time.

vanthome commented 1 month ago

Thanks @joneuhauser for the clarification. I was really astonished when I tested this document with Inkscape and saw that the Justified alignment actually works natively (while maintaining editability). We need to use this in an automated process though and unfortunately Inkscape has no C API that would allow us to tightly integrate it. Are you aware of any other SVG engine/ tool that understands text-align: justify;?