Comments (4)
The wrap-flow
property is applied to the excluded element, to define how text wraps around it. It is therefore not appropriate for controlling wrapping within a shape.
A single element might need both external and internal wrapping controls. For example, a pull quote in a magazine layout: you want the quote to wrap to a shape, but you also want the column text to wrap around it. See an example here of dual wrapping. Now imagine the leaf shape was a maple leaf or something else with deep lobes that interrupt the text. Do you want to continue the text on the other side of the interruption or not?
I think it is important to have author control over this, so we would need a new property. It would also be needed for CSS Shapes 2 / CSS Exclusions (which would define how to create layouts like the linked example).
The values for the new property (wrap-inside
?) would be similar to those for wrap-flow
, but with the important distinction that there could be more than two shape regions that intersect any given line of text. I would suggest the following options:
all
Text fills any region of the shape that it can fit into while respecting word breaks, continuing in straight lines.start
Text fills the first shape region on each line (based on text direction), continuing until it reaches a shape edge, then shifts to the next line.end
Text fills the first shape region on each line (based on text direction), continuing until it reaches a shape edge, then shifts to the next line.minimum
Text only fills the shortest continuous section of the shape for that line.maximum
Text only fills the longest continuous section of the shape for that line.
I would suggest that either all
, start
or maximum
be chosen as the default value.
I can put together a demo of the options, if @Tavmjong does not already have something similar.
Note that I do not think that this property would be a reasonable way of dealing with flowing text from one shape to another, as describe in Issue #38. That is about filling one shape neatly, then moving to the next, like flowing from one column to another.
from svgwg.
From the CSS/SVG working group joint face to face in Sydney on 3 February 2016, the following were confirmed:
- Default behavior for exclusions should be to break the text into separate line boxes before and after each interruption in the shape, similar to Tab's figure:
- The ability to control this behavior is desirable, and could be added with a new property in future.
from svgwg.
Examples of the same shape with different wrapping scenarios. Text is manually positioned, so padding is not super precise and hyphenation may be non-standard, but you get the gist:
The example brings up a problem with maximum
(and also minimum
): what happens when multiple spans along a line have the same available width? (This is also an issue with minimum/maximum for wrap-flow
, and correct behavior is not currently defined in the CSS Exclusions spec.) I have fallen back to start
for the example here.
from svgwg.
It was decided at the joint CSS/SVG working meeting that text is laid out on both sides of a hole. The SVG 2 spec has been updated.
from svgwg.
Related Issues (20)
- Sizing properties section should link to a more recent references
- Should SVG's `<script>` element support the `fetchpriority` attribute analogous to HTML's `<script>` element? HOT 2
- Should support async and defer attributes on script elements
- Specification of the behaviour of `inline-size: 0`
- No way to construct a TimeEvent, so its initTimeEvent method is fully useless
- The IDL of SVGSVGElement.getElementById does not allow null
- Should SVG's `<image>` element support the `fetchpriority` attribute analogous to HTML's `<img>` element? HOT 1
- Decimal point not allowed according to Path Data ENBF HOT 3
- Enable lazy loading for URLs on use href HOT 1
- Does SVG support Custom elements? HOT 1
- Error about drawto_command in SVG 2.0 path EBNF HOT 2
- What should happen when trying to insert empty strings or separators into SVGStringList
- SVGAElement.prototype.text should be removed HOT 6
- Serialization of transform functions and transform attribute.
- Update UA stylesheet rules to use :any-link instead of :visited or :link HOT 2
- Incorrect description of path horizontal and vertical movement HOT 7
- Publish current status of SVG
- Is the `path()` function allowed for the `d` property? HOT 2
- Can we fix arc interpolation? HOT 4
- Implementing CSS Text Wrapping in SVG HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgwg.