Script commands for textframes

Previous topic - Next topic

Oldi

Dear All,
first of all, I whish all Scribus-Users a happy new year!

Said that, now to my concerns  ;)

I am a newbee-user with Scribus but feel already quite comfortable with it. I really like the scripting engine, as this has really a huge potential. However, this potential seems a bit limited as it seems that not all possible commands are usable as a script-command. My biggest problem with Scribus is how to handle and design tables. One has to select each textbox and format by hand. Thanks to the scripting engine, I managed to reduce the required time for designing a table.

Sadly, only 6 commands seem to be available for modifying text namely

  • setFont
  • setFontSize
  • setFontSize
  • setLineSpacing
  • setTextAlignment
  • setTextColor

That´s already great, but I definitley miss the "first line offset" or "center vertical".

Is anybody aware if there is either a command or a workaround?

thx!
Oldi

GarryP

Hi Oldi.

Welcome to the Scribus forum.

I can't help with the scripting side of things but - as of 1.4.3 - Scribus doesn't have a "centre vertical" function for text. A manual offset needs to be made using the "Columns & Text Distances" section of the "Text" tab of the "Properties" palette. I have no idea whether this can be controlled in a script.

I just thought it would be worth mentioning in case you put in lots of time looking for such a function. For formatting, if it's not in the GUI it's unlikely to be in the API, in general anyway.

P.S. A "centre vertical" function for text sounds nice, in theory, but what would it use as the centre of the text? For instance, for a single line of text with only one initial capital, it sometimes looks better "centred" at half x-height rather than half cap-height. And how would the function handle ascenders, descenders, or overshoot? And how would it handle multiple lines where you don't necessarily know where the bottom of the text will be when you start rendering at the top? As you can see, it quickly gets very complicated with a lot of options that need control or arbitrary defaults. Basically what I'm saying is that "centre vertical" isn't as simple as it may seem at first and that's probably one of the reasons why it hasn't been added to Scribus yet. (But it would be nice to have one to save time for simple things nonetheless.)

Vin_Dunkelheit

Hello, Oldi.

Where did you get these six commands? I can't find them anywhere... Thanks.