Text in shape alignment

Discuss SVG code, accessible via the XML Editor.
amagick
Posts: 4
Joined: Sun Mar 01, 2015 6:00 pm

Text in shape alignment

Postby amagick » Sat Mar 07, 2015 5:52 pm

Hi,

I have problem with the alignment of the text.

I try to reproduce the alignment as the first image. The words are automatically cut to keep the shape of the object.

Do you have any idea? Is there a property in SVG code ?

Thank you

IMAGE 1
Image


IMAGE 2
Image

Code: Select all

<svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2"  xmlns:xlink="http://www.w3.org/1999/xlink" width="800px" height="800px" viewBox="0 0 800 800">

<defs><path id="heartPath" fill="none" d="M285 85C251.027 3.42297 146.84 -23.1268 75 24.0787C36.6194 49.2982 14.0911 93.1698 4.42438 137C-19.2116 244.168 48.5056 344.488 117.91 419C136.693 439.164 157.191 457.749 179 474.65C203.401 493.56 228.854 511.008 256 525.769C263.828 530.026 276.745 539.998 286 539.397C292.967 538.944 301.879 532.509 308 529.297C325.954 519.876 343.158 509.282 360 497.999C432.582 449.373 498.491 379.985 538.742 302C575.088 231.581 584.309 145.579 542.548 75C504.563 10.8028 419.395 -21.7473 351 15.3087C321.005 31.5596 301.971 56.2227 285 85z"/></defs>

<flowRoot style="font-size:26px;fill:#ffffff;font-weight:normal;line-height:100%;">
   <flowRegion><use xlink:href="#heartPath"/></flowRegion>
   <flowPara>a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example  a text for example </flowPara>
</flowRoot>

</svg>

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Text in shape alignment

Postby brynn » Sat Mar 07, 2015 6:50 pm

Honestly, I'm not sure about the answer to this, at the moment. I'll fire up Inkscape in a minute, a try to find a solution. But my first thought is to try setting the text alignment to either centered or left and right justified (which I think Inkscape calls "justify"). The buttons are on the Text tool control bar.

(Your top example looks like the latter.) (to me :D)

Edit
Now having tried it, that seems to have worked for me.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Text in shape alignment

Postby tylerdurden » Sun Mar 08, 2015 1:18 am

One difference I see, is that Inkscape wraps the lines at words, not mid-word.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Text in shape alignment

Postby brynn » Sun Mar 08, 2015 6:40 am

tylerdurden wrote:One difference I see, is that Inkscape wraps the lines at words, not mid-word.


Yeah, I don't think Inkscape offers any hyphenation of words at the end of lines. It's a little irritating, if you do a lot of work with Text tool and text. But Inkscape isn't a text editor, after all, and not even this message editor can hyphenate at the end of lines.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Text in shape alignment

Postby tylerdurden » Sun Mar 08, 2015 8:08 am

The OP's example wrap does not hyphenate, but it breaks words at the closest letter to the edge. For all we know, it could be handmade. In that case, Inkscape is as good as any.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Text in shape alignment

Postby Lazur » Sun Mar 08, 2015 8:27 am

For a similar effect you can try mosascii.


Return to “SVG / XML Code”