Applying a Frame Style: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
|[[File:Newsframe3.png]]
|[[File:Newsframe3.png]]
|}
|}
What you see above are, from left to right, the starting point of a frame filling to margins on an A4 document with sample text, then running the script for 3 columns, then 2 columns, then 1 column.
What you see above are, from left to right, the starting point of a frame filling to margins on an A4 document with sample text, then running the script for 3 columns, then 2 columns, then 1 column. One can readily imagine that an option ''could'' be to specify where to position a one or two-column frame, with the one-column having 3 choices and the two-column 2 choices, but this is not what what seemed to be indicated in this mail list example. Generally, it's better to keep a script as simple as needed – it can always be made more complex later.

Revision as of 17:01, 5 July 2011

This article is part of the Scripts series.

Although frame styles do not exist as yet, one way of simulating them would be with Scripter, since we have available most if not all the commands that would be needed to accomplish something like this.

A question on the mailing list asked about whether there was some way to create and apply "frame styles", in this case meaning particular settings for columns, column gaps, and the text distances.

To be more specific:

As an example, for a newsletter project that I have been involved with, we have determined that for the A4 pages we use, 
most frames (and almost *all* text frames) should have widths in multiples of 65mm - which comprises 60mm for the text, 
and 5mm for the gap between the text and the left and right borders (ie, two 2.5mm gaps); and therefore  multi-column frames
should have the column gap set to 5mm.

And from this along with desired gaps to page edges, comes the 'correct' X-pos settings for most frames: 7.5mm, 72.5mm, 
or 137.5mm (this gives us a total gap of 10mm from page edge to left edge of the text). 
 
Hence for any frame (text or image) a single-column frame should be  65mm, a double-column frame should be 130mm, and a 
triple-column frame  should be 195mm; and should have its X-pos set to one of 7.5mm, 72.5mm  or 137.5mm. 

So taking these values as a starting point, here is an illustration of how to set up a very simple means to apply settings to a text frame. This is a very simple script, even operationally, where the only input from the user is to specify the number of columns.

Newsframe.png Newsframe1.png Newsframe2.png Newsframe3.png

What you see above are, from left to right, the starting point of a frame filling to margins on an A4 document with sample text, then running the script for 3 columns, then 2 columns, then 1 column. One can readily imagine that an option could be to specify where to position a one or two-column frame, with the one-column having 3 choices and the two-column 2 choices, but this is not what what seemed to be indicated in this mail list example. Generally, it's better to keep a script as simple as needed – it can always be made more complex later.