-1

I need something like this in svg my mean is when is set text in big area , text don't get to shape area and break to new line , and when get the wide area fill all space

  --------------  |-------------------|
 |              | |                   |
 |  some shape  | |   set some text   |
 |              | |                   |
  --------------  |                   |
 -----------------|                   |
 |                                    |
 |                                    |
 |                                    |
 |____________________________________|

I try some result of my search but doesn't work. I think this is very simple. My english is very bad so i don't know use what keyword to get my result. I want to export pdf with mpdf and need this style of text. thanks.

Farshadi
  • 143
  • 1
  • 12

1 Answers1

2

SVGs are easy to create by hand if you familiarise yourself with the SVG element.

<svg width="400" height="280">
  <rect x="2" y="2" width="170" height="120"
        fill="none" stroke="black" stroke-width="4"/>
  <text x="85" y="70"
        font-size="20" text-anchor="middle">some shape</text>

  <path d="M 200,2 L 398,2 L 398,278 L 2,278 L 2,150 L 200,150 Z"
        fill="none" stroke="black" stroke-width="4"/>
  <text x="300" y="70"
        font-size="20" text-anchor="middle">set some text</text>
</svg>

If you don't think you can create an SVG by hand, then you should use a vector editor. There are many, but a free one is Inkscape.

Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181
  • Thank you very much for answer but I Think I told my question very bad :( my mean is when is set text in big area , text don't get to shape area and break to new line , and when get the wide area fill all space, can I explain my question? – Farshadi Sep 01 '17 at 12:15
  • SVG text does not wrap like HTML. You have to specify where the text goes yourself. [See this question for some ways around this problem](https://stackoverflow.com/questions/4991171/auto-line-wrapping-in-svg-text) – Paul LeBeau Sep 01 '17 at 12:24