[scribus] scribus script for Lightning Source, Inc. (LSI) templates

W. F. Zimmerman wfz at nimblebooks.com
Thu Aug 27 23:18:35 CEST 2009


Here is a Scribus script that sets up (approximately!!) most of what you
need to create a 6 x 9" trade paper back cover in Scribus using the LSI
templates.
John C., I realize that there is another, probably better way to do this
using the Scribus page calculator, but I suspect many LSI users like me and
feel it is safer to start with LSI's templates. for one thing, you have to
use the LSI template in order for LSI to digitally certify you (saves $ on
set up fees).

I emphasize the word *approximately* because without spine width
calculations (just haven't done yet) the text and image boxes are only
approximately located on the page. you have to drag and drop them to the
right spot.  but the good news is that all the layers, images, and text
frames are created with one click, and they are the right height and width.

Techies, feel free to add to this script. It is dumb bunnies' open source.

Fred




#!/usr/bin/env python

'''
A script to add new named layers to a template for a 6 x 9 LSI page.
Requires an existing document, but can be modified to
create a new document if it does not exist.

uses (See the API in Help->Scribus Manual->For Developers->Scripter API;
 haveDoc
 createLayer
 getActiveLayer
 setActiveLayer
 createText
 setUnit
 setText
 setTextColor
 setFontSize
 rotateObject

'''

from scribus import *

if haveDoc():
    setUnit=UNIT_INCHES
    defineColor("NimbleBlue",255,171,0,158)
    defineColor("NapoleonicGreen",187,0,199,186)
    createLayer("Fill")
#for 6 x 9 pages
#create fill
    createRect(1.47,0,12.5,9.25,"CoverFill")
    setFillColor("NimbleBlue","CoverFill")
    createLayer("FrontImage")
#create image box in middle of front cover
    createImage(7.93,2.33,5.75,3.5,"FrontCoverImage")
    createLayer("BackImage")
    createLayer("FrontText")
#create Title box
    createText(7.93,0.23,5.75,2,"Title")
    setTextColor("White","Title")
    setFont("Constantia Regular","Title")
    setFontSize(44,"Title")
    setTextAlignment(ALIGN_CENTERED,"Title")
    setText("Title Text","Title")
# create Subtitle box
    createText(7.93,2.23,5.75,2,"Subtitle")
    setTextColor("White","Subtitle")
    setFont("Constantia Regular","Subtitle")
    setFontSize(32,"Subtitle")
    setTextAlignment(ALIGN_CENTERED,"Subtitle")
    setText("Subtitle Text","Subtitle")
# create byline box
    createText(7.93,6.23,5.75,2,"Byline")
    setFont("Constantia Regular","Byline")
    setTextColor("White","Byline")
    setFontSize(32,"Byline")
    setTextAlignment(ALIGN_CENTERED,"Byline")
    setText("By Author Name","Byline")
# create Nimble Books logo
    createText(7.93,7.23,5.75,0.5,"NimbleLogo")
    setFont("Constantia Regular","NimbleLogo")
    setTextColor("White","NimbleLogo")
    setFontSize(14,"NimbleLogo")
    setTextAlignment(ALIGN_CENTERED,"NimbleLogo")
    setText("Nimble Books LLC","NimbleLogo")
    createLayer("BackText")
#create Back text box
    createText(1.72,0.23,5.75,6,"Backtext")
    setTextColor("White","Backtext")
    setFont("Constantia Regular","Backtext")
    setFontSize(11,"Backtext")
    setTextAlignment(ALIGN_LEFT,"Backtext")
    setText("paras go here","Backtext")
#create Spine
    createLayer("Spine")
#create Spine top text
    createText(7.6,0.3,1.5,0.5,"SpineTop")
    setFont("Constantia Regular","SpineTop")
    setTextColor("White","SpineTop")
    setFontSize(11,"SpineTop")
    setTextAlignment(ALIGN_LEFT,"SpineTop")
    setText("Author and Short Title","SpineTop")
    rotateObject(270,"SpineTop")
#create white rectangle that sits underneath standard LSI ISBN
    createRect(3.72,7.23,2.2,1.493,"UnderISBN")
    setFillColor("White","UnderISBN")
#create ISBN layer
    createLayer("ISBN")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20090827/b52f4158/attachment.htm>



More information about the scribus mailing list