[scribus] Vertical alignment?

Jeremy Apthorp nornagon at gmail.com
Mon Mar 30 14:14:02 CEST 2009


2009/3/30 a.l.e <ale.comp_06 at xox.ch>:
> hello
>>>
>>> Out of interest, why is it tricky ?  It sounds easy from my naive
>>> perspective.  I'm curious.
>>
>> Well, not being one of the devs, I'm can't be sure. With horizontal
>> centering, you're dealing with one line of text, but with vertical one or
>> maybe several lines of text. I try to think of what I might need in Scripter
>> for feedback so that I might automate such a process, and it isn't easy for
>> me to conceive what that is. In the main GUI, there is an ability to set a
>> Top space from the frame border to the beginning of text, but the resulting
>> bottom space is a secondary passive amount -- does or can Scribus know what
>> this is?
>
> i'm not one of the devs, either... but the author of the script which
> vertically centers the text in a frame:
>
> http://wiki.scribus.net/index.php/Adjust_a_text_frame_to_fit_its_content#center_.28vertical.29_align_the_content_of_a_text_frame
>
> the script only aligns the text in its current state. so if you add more
> text, it won't be centered anymore: it's a static alignement.
>
> the API which is available for scripting doesn't enable a dynamic centering
> and in the current state of scribus, it wouldn't make much sense either.

As I understand it, your code pushes the text down until it overflows,
then halves the distance (or something like that).

Is there any reason this can't be done purely from font metrics? You
know the height of the font and the height of the line, so just add
them up for each line and place the text in the centre.

Jeremy




More information about the scribus mailing list