vertically centered text

Post questions on how to use or achieve an effect in Inkscape.
zuencap
Posts: 4
Joined: Thu Jun 16, 2011 8:53 pm

vertically centered text

Postby zuencap » Thu Jun 16, 2011 9:12 pm

Hi all,
I want to create a flow text which is vertically centered. It should not be a one time solution. I mean whenever I change the text I want inkscape align it automatically. Is there a text attribute to do that?
Erdem

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

Re: vertically centered text

Postby brynn » Fri Jun 17, 2011 6:46 am

Image
Welcome to the forum, Erdem!

You can center the text using the Align and Distribute dialog (Object menu). Here's the maual info: http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Align.html.

Let us know if that works. If not, we'll try again :D

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: vertically centered text

Postby llogg » Fri Jun 17, 2011 9:03 am

Your question is too vague. Please explain what you mean by "vertically centered". Do you mean that text alignment within your flowed text should be centered (i.e., each line of text is centered relative to the other lines of text) or that the text object should be centered relative to other objects or the page (i.e., brynn's suggestion), or that you want the text to run vertically rather than horizontally (i.e., reads top to bottom rather than left to right)? For option 3 see: http://tavmjong.free.fr/INKSCAPE/MANUAL ... rientation
For option 2 see brynn's response.
For option 1 see: http://tavmjong.free.fr/INKSCAPE/MANUAL ... -FontStyle

For none of the above, post a more specific question.

zuencap
Posts: 4
Joined: Thu Jun 16, 2011 8:53 pm

Re: vertically centered text

Postby zuencap » Thu Jul 07, 2011 11:32 pm

Thanks for replies.

I'm sorry that I didn't see your replies until now (I don't know why) and for my vague question.

I have attached a test file. What I basically want is text "erdem" (flowPara4381) is automatically placed in the vertical center of rect4379 which is flow region of example flow text.

It is currently horizontally centered. I want the same thing for vertical centering. So whenever I modify the text it will be placed in the middle of the flow region automatically (even if it is more than one line).

Or more technically I'm looking for something like html vertical-align attribute:

Code: Select all

<td style="vertical-align:middle"> ... </td>


Or if I need to code:

Code: Select all

totalHeight = 0
for line in allLines; do
   totalHeight += line.height

setFirstLineY( (flowRegion.height - totalHeight)/2 + flowRegion.y )


I don't know anyother way to explane myself :) Sorry, not a verbally strong man.

Cheers
Erdem
Attachments
test.svg.zip
test svg
(1.08 KiB) Downloaded 169 times

zuencap
Posts: 4
Joined: Thu Jun 16, 2011 8:53 pm

Re: vertically centered text

Postby zuencap » Wed Jul 20, 2011 7:41 pm

Any answers?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: vertically centered text

Postby ~suv » Wed Jul 20, 2011 7:53 pm

zuencap wrote:Any answers?

Answer I: known (but not yet implemented) feature request, see Bug #497641 in Inkscape: “vertically align text

Answer II: no, currently Inkscape cannot vertically align text content (<tspan>s) or flowed text paragraphs relative to the text frame, but it's a known feature request. Please keep in mind that the current 'Flowed Text' implementation in Inkscape was based on a later dropped proposal for SVG 1.2, and AFAIU it's not clear yet how this implementation will change once a newer SVG specification will include more text formatting features.

zuencap
Posts: 4
Joined: Thu Jun 16, 2011 8:53 pm

Re: vertically centered text

Postby zuencap » Wed Jul 20, 2011 8:05 pm

Thanks ~suv.


Return to “Help with using Inkscape”