-
Notifications
You must be signed in to change notification settings - Fork 132
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
Implementing CSS Text Wrapping in SVG #942
Comments
The feature is simple to specify, doesn't involve any fundamentally new or difficult concepts, and is clearly a valuable use-case. I don't think there's anything that needs to be done (or can be done) on the spec level for this; it's just about getting one or more implementations to actually pull the trigger. I'm not sure what the best way to do that would be, tho, besides the usual approaches (file bugs, get people riled up to star the bugs, etc). |
A native text-wrapping feature in SVG would be a quantum leap!I'm pretty sure that many implementers are more than willing to do so - I think Inkscape is already a good example of this. In short: WishlistPlease also consider to ...
Simple multiline capabilities first – fancy shape text-composing later (please=)The specification should focus first on simple multiline/line wrapping capabilities – as used even before CSS and painstakingly implemented by most SVG visualisation libraries. Manual breaks for SVGAn equivalent to HTML's
CSS vs presentation attributesIf CSS Besides, I don't think we can get the perfect CSS-only shift – at least not any time soon: We'll need a lot of convertersNot an issue at all as we won't fix abysmal SVG support overnight, but as long as we have a reference we can write a conversion tools/scripts. To be clear, it is not my intention to belittle the efforts of the current or past members of the working group. I'm just very passionate about this mysteriously confused and seemingly intractable SVG core bug concerning SVG's text capabilities. |
Glad to see enthusiasm on this topic! A few observations about your thoughts: SimplicityThe overall goals here are simplicity of implementation and familiarity to authors. CSS text layout is the easiest way to accomplish those goals. An implementation doesn't need to support all of CSS to do this, only those parts of CSS that are applicable to SVG. I'm not aware of any major SVG authoring tool that doesn't support at least a subset of CSS, so I don't see the need to add new presentation attributes. If an implementation's CSS support is lacking, it would be no harder for them to improve their text layout with CSS syntax than with attribute syntax. I agree that wrapping text in shapes is unneeded complexity. It has its use cases, but it shouldn't impede the most common case, rectangular blocks of text. No new syntaxBrowsers aren't going to add new elements or attributes. They just aren't. If anything, they're inclined to remove features from SVG. So asking for additional elements or attributes is simply a non-starter, unfortunately. Naturally, I agree with your use cases. So we should find a way to leverage existing SVG or CSS syntax and features to accomplish those goals. In the case of a ConvertorsAny authoring tool based on a browser engine (e.g. an Electron app or a web-based authoring tool) would already have the same support as the browser. For other authoring tools (e.g. Inkscape or Illustrator), they could simply add the support natively. It's not that much extra work, and they already have text-layout tools; they'd just need to align those to CSS layout. Of course, it would be nice to have a convertor from automatic to manual text-wrapping SVG for older versions of authoring tools, but honestly that would be trivial to make. I don't see this as a serious roadblock. ConclusionIn short, the simpler and less demanding the request, the more likely it will be implemented and deployed. Browsers, not other SVG tools, are the blocker for interoperable improvements to SVG. The simplest ask is for browsers to allow SVG to use their existing CSS text-wrapping, with no special cases or new elements or attributes. |
Inkscape already implements SVG 2 text wrapping (and has for a long, long time). |
@shepazu: Thanks a lot for your response! Sorry for my line-break obsession. Manual line breaks via
|
Wrapping text remains a serious problem in SVG. The SVG 2 specification defines a mechanism for text-wrapping using the existing CSS text-wrapping algorithm, which should be pretty simple to implement.
While there doesn't seem to be an appetite for implementing new features for SVG, this particular one is low-hanging fruit that would be a major benefit for authoring SVG and SVG libraries. In particular, SVG has become the default language for charts on the web, and improving text handling would be a boon there.
Do you see a path forward on this one, @tabatkins?
The text was updated successfully, but these errors were encountered: