Text wrapping within a bounding box or `Rect`
See original GitHub issueI understand SVG’s don’t natively support text wrapping but would like to see if there is any support provided within this library, as I have created a small piece of code to demonstrate the issue I am getting.
Ideally, I would like my text to wrap naturally within the bounding box like we have p
tag within a div
container.
Following is the React Native code I am using;
<Svg height={height * 0.5} width={width} viewBox={`0 0 ${height * 0.5} ${width}`}>
<Rect x={0} y={0} rx={10} ry={10} width={width} fill="#4682b4" stroke="black" stroke-width="5" opacity=".5" height={49.5}></Rect>
<Text x={0} y={0} dx={20} dy={20} fontSize={14} fontFamily="arial" fill="red">
{scorpioText}
</Text>
</Svg>
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Learn how to wrap text around objects in InDesign
In the Text Wrap panel, click the desired wrap shape: Wrap Around Bounding Box. Creates a rectangular wrap whose width and height are ......
Read more >Bounding box of wrapped text - qt - Stack Overflow
I want to draw a rectangle around a QML Text object that is using word wrapping. TextMetrics seems like it would be ideal,...
Read more >Understanding images: Part 2 - Wrapping styles - Microsoft
The most common wrapping style is Square, which means the text wraps around a rectangular box (called a “bounding box”) that encloses the ......
Read more >Text wrapping within a bounding box or Rect #862 - GitHub
Ideally, I would like my text to wrap naturally within the bounding box like we have p tag within a div container. Following...
Read more >Wrap text and new bounding box - YouTube
Cricut commenced rolling out a new Design Space update for both the Desktop App and the iOS app. In this video I'll go...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@msand whats the proper usage for
inlineSize
? I attempted to set it to the width of my SVG container, but it doesn’t seem to auto wrap the text.version:
9.6.4
RN version:0.59.4
Also https://developer.mozilla.org/en-US/docs/Web/CSS/inline-size https://www.w3.org/TR/SVG2/text.html#InlineSize