[scribus-dev] cover.py script for perfect bound book cover design is ready.

Gregory Pittman gpittman at iglou.com
Fri Dec 19 01:02:23 UTC 2014


On 12/18/2014 03:18 PM, John Culleton wrote:
> With the very welcome advice of JLuc and
> Gregory Pittman and the availability of the
> spine.py script as a model I have a production
> version of the script cover.py.
>
> In gross this script terms does what what the
> Perfect Bound Cover extension does for Inkscape
> users and what my previous template.html did in
> more limited fashion for Scribus users.
>
> The data fields are:
> 1. Number of pages
> 2. Pages per inch (PPI) of the interior pages.
> 3. Finished book width.
> 4. Finished book height
> 5. Allowance for the thickness of the cover
> stock plus some additional distance for the fold.
> A recommended value is 0.017 inch.
>
> The one improvement that I see as useful would be
> to combine all the data entry fields into one
> window instead of producing a separate window
> sequentially for each data field. I don't know
> how to do this.
I know JLuc has advocated tkinter, but I find tkinter rather obtuse and 
complex.
These days my preferred method for multiple data entry in one dialog is 
to have data entered separated by white space, for example, from 
http://wiki.scribus.net/canvas/A_Standard_Form_with_Barcodes_and_Custom_Entries 
:

adm_hospnum = scribus.valueDialog('Admit Date + Hospital Number','Admission Date (MM/DD/YYYY) and\n 10-digit Hospital No.\n(Separate with white space only)')
adm_hosp = adm_hospnum.split()

Using this .split function creates a list, which can then be accessed 
with adm_hosp[0], adm_hosp[1], and adm_hosp[2] (remember these are 
string values that would need to be converted to numerical with int() or 
float() to use in a formula).
The script that you're making is for an experienced user, or someone who 
quickly becomes an experienced user. Data entry is on a single line, 
with each value separated by white space (it doesn't matter how big - 
one space or many). In your case, you're only talking about 5 values. 
Even so, it's important to put specifics in the valueDialog text to 
explain the order of expected information, so you might have:

book_data = scribus.valueDialog('Book Data', 'No. of Pages, Pages per 
Inch, Book width, Book height, Cover stock thickness (separated by white 
space only)')
book_values = book_data.split()

> When the fields are filled out a base document
> correctly sized becomes the current document for
> Sribus.
>
> FEATURES
> There are two vertical guides marking off
> the edges of the spine. There are also vertical
> guides bisecting  the back cover, the
> spine and the front cover.
>
> There are solid blue margins spaced 0.375 inch
> from each edge. These margin guides are designed
> to prevent text and similar entities from
> approaching too close to the finished edges. The
> distance consists of the bleed of 0.125 inch plus
> a safety margin of 0.250 inch.
You may have to allow for other units to be used. It could be 
semiautomated by detecting the native units of the document. Generally 
it's going to be a problem not to consider that many if not most Scribus 
users are using EU measurements or points.
>
> I tested it with Scribus 1.4.5, 1.5.0.
> Now who wants a copy of the script to bash it
> around before I submit it for inclusion with the
> two releases? I'll post it at
> http://wexfordpress.net
> Your comments are most welcome.
>
>
I'd like to take a look at it. With your permission, this would be a 
good addition to the wiki. I think we need some collective feedback that 
this deserves to be an included script before we commit it to Scribus.

Greg



More information about the scribus-dev mailing list