Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG2 text example uses text-align:justified #791

Open
joneuhauser opened this issue Apr 11, 2020 · 5 comments
Open

SVG2 text example uses text-align:justified #791

joneuhauser opened this issue Apr 11, 2020 · 5 comments

Comments

@joneuhauser
Copy link

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
Copy link

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

@Crissov
Copy link

Crissov commented Sep 26, 2024

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

@vanthome
Copy link

vanthome commented Oct 2, 2024

Somis SVG 2 dead?

@joneuhauser
Copy link
Author

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
Copy link

vanthome commented Oct 3, 2024

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;?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants