question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text wrapping within a bounding box or `Rect`

See original GitHub issue

I 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>

simulator screen shot - iphone 6s - 2018-12-02 at 13 12 15

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Taylor123commented, Aug 20, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found