Applying a Frame Style: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(Created page with "{{Scripting Index}} 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 ...")
 
No edit summary
Line 1: Line 1:
{{Scripting Index}}
{{Scripting Index}}
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.
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.
[http://lists.scribus.info/pipermail/scribus/2011-July/043412.html 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:
<pre>
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.
</pre>
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.
{|
|[[File:Newsframe.png]]
|[[File:Newsframe1.png]]
|[[File:Newsframe2.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.

Revision as of 16:52, 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.