Next / Previous / Contents / Shipman's homepage

7.3. fosoxtest: Manifest constants

fosoxtest
# - - - - -   M a n i f e s t   c o n s t a n t s

For this application we'll need two simple-page-master elements, one for odd pages and one for even pages. We'll also define the name for the page-sequence-master element.

fosoxtest
#--
# Names of the simple master and the repeatable master
#--
ODD_MASTER = "odd"
EVEN_MASTER = "even"
REPEAT_MASTER = "all"

Next we'll define the names for the header and footer regions on those pages.

fosoxtest
#--
# Region names
#--
ODD_BEFORE = "odd-before"
ODD_AFTER = "odd-after"
EVEN_BEFORE = "even-before"
EVEN_AFTER = "even-after"

Next we'll use Section 6.5, “pageDimsFactory(): Some pre-built PageDims instances” to produce two instances of the PageDims class to contain the layout parameters for the odd and even pages. Each starts with the basic letter paper layout; then we add a more generous left margin on odd pages and a more generous right margin on even pages, for the binding.

fosoxtest
#--
# Page dimensions
#--
ODD_DIMS = f.pageDimsFactory(f.PAPER_LETTER)
ODD_DIMS.pageMargins.left = "1.5in"
EVEN_DIMS = f.pageDimsFactory(f.PAPER_LETTER)
EVEN_DIMS.pageMargins.right = "1.5in"

Next we define the main font family and then three fonts of this family for the header, footer, and body faces.

fosoxtest
#--
# Fonts
#--
MAIN_FAMILY = "Palatino, Paladino, serif"
HEAD_FONT = f.font(fontFamily=MAIN_FAMILY, fontSize="10pt")
FOOT_FONT = f.font(fontFamily=MAIN_FAMILY, fontSize="10pt",
                   fontStyle="italic")
BODY_FONT = f.font(fontFamily=MAIN_FAMILY, fontSize="12pt")