reportlab/demos/pythonpoint/styles_horrible.py
author rgbecker
Wed, 16 Feb 2000 09:42:50 +0000
changeset 10 0cb88428a663
parent 7 ca9eb4f68eab
child 16 f9c7525619fb
permissions -rw-r--r--
Conversion to reportlab package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     1
###############################################################################
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     2
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     3
#	ReportLab Public License Version 1.0
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     4
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     5
#   Except for the change of names the spirit and intention of this
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     6
#   license is the same as that of Python
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     7
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     8
#	(C) Copyright ReportLab Inc. 1998-2000.
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
     9
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    10
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    11
# All Rights Reserved
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    12
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    13
# Permission to use, copy, modify, and distribute this software and its
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    14
# documentation for any purpose and without fee is hereby granted, provided
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    15
# that the above copyright notice appear in all copies and that both that
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    16
# copyright notice and this permission notice appear in supporting
7
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    17
# documentation, and that the name of ReportLab not be used
4
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    18
# in advertising or publicity pertaining to distribution of the software
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    19
# without specific, written prior permission. 
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    20
# 
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    21
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    22
# Disclaimer
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    23
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    24
# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    25
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    26
# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    27
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    28
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    29
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    30
# PERFORMANCE OF THIS SOFTWARE. 
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    31
#
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    32
###############################################################################
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    33
#	$Log: styles_horrible.py,v $
10
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    34
#	Revision 1.3  2000/02/16 09:42:50  rgbecker
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    35
#	Conversion to reportlab package
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    36
#
7
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    37
#	Revision 1.2  2000/02/15 17:55:59  rgbecker
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    38
#	License text fixes
10
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    39
#	
7
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    40
#	Revision 1.1.1.1  2000/02/15 15:09:05  rgbecker
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    41
#	Initial setup of demos directory and contents.
ca9eb4f68eab License text fixes
rgbecker
parents: 4
diff changeset
    42
#	
10
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    43
__version__=''' $Id: styles_horrible.py,v 1.3 2000/02/16 09:42:50 rgbecker Exp $ '''
4
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    44
# style_modern.py
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    45
"""This is an example style sheet.  You can create your own, and
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    46
have them loaded by the presentation.  A style sheet is just a
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    47
dictionary, where they keys are style names and the values are
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    48
layout.ParagraphStyle objects.
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    49
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    50
You must provide a function called "getParagraphStyles()" to
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    51
return it.  In future, we can put things like LineStyles,
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    52
TableCellStyles etc. in the same modules.
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    53
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    54
You might wish to have two parallel style sheets, one for colour
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    55
and one for black and white, so you can switch your presentations
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    56
easily.
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    57
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    58
A style sheet MUST define a style called 'Normal'.
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    59
"""
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    60
10
0cb88428a663 Conversion to reportlab package
rgbecker
parents: 7
diff changeset
    61
from reportlab.platypus import layout
4
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    62
def getParagraphStyles():
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    63
    """Returns a dictionary of styles based on Helvetica"""
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    64
    stylesheet = {}
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    65
    ParagraphStyle = layout.ParagraphStyle
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    66
    
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    67
    para = ParagraphStyle('Normal', None)   #the ancestor of all
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    68
    para.fontName = 'Courier'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    69
    para.fontSize = 24
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    70
    para.leading = 28
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    71
    stylesheet['Normal'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    72
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    73
    para = ParagraphStyle('BodyText', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    74
    para.spaceBefore = 12
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    75
    stylesheet['BodyText'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    76
    
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    77
    para = ParagraphStyle('BigCentered', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    78
    para.spaceBefore = 12
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    79
    para.alignment = layout.TA_CENTER
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    80
    stylesheet['BigCentered'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    81
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    82
    para = ParagraphStyle('Italic', stylesheet['BodyText'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    83
    para.fontName = 'Courier-Oblique'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    84
    stylesheet['Italic'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    85
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    86
    para = ParagraphStyle('Title', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    87
    para.fontName = 'Courier'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    88
    para.fontSize = 48
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    89
    para.Leading = 58
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    90
    para.spaceAfter = 36
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    91
    para.alignment = layout.TA_CENTER
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    92
    stylesheet['Title'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    93
    
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    94
    para = ParagraphStyle('Heading1', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    95
    para.fontName = 'Courier-Bold'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    96
    para.fontSize = 36
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    97
    para.leading = 44
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    98
    para.spaceAfter = 36
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
    99
    para.alignment = layout.TA_CENTER
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   100
    stylesheet['Heading1'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   101
    
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   102
    para = ParagraphStyle('Heading2', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   103
    para.fontName = 'Courier-Bold'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   104
    para.fontSize = 28
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   105
    para.leading = 34
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   106
    para.spaceBefore = 24
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   107
    para.spaceAfter = 12
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   108
    stylesheet['Heading2'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   109
    
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   110
    para = ParagraphStyle('Heading3', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   111
    para.fontName = 'Courier-BoldOblique'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   112
    para.spaceBefore = 24
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   113
    para.spaceAfter = 12
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   114
    stylesheet['Heading3'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   115
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   116
    para = ParagraphStyle('Bullet', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   117
    para.firstLineIndent = 54
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   118
    para.leftIndent = 72
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   119
    para.spaceBefore = 6
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   120
    #para.bulletFontName = 'Symbol'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   121
    para.bulletFontSize = 24
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   122
    para.bulletIndent = 36
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   123
    stylesheet['Bullet'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   124
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   125
    para = ParagraphStyle('Definition', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   126
    #use this for definition lists
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   127
    para.firstLineIndent = 72
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   128
    para.leftIndent = 72
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   129
    para.bulletIndent = 0
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   130
    para.spaceBefore = 12
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   131
    para.bulletFontName = 'Couruer-BoldOblique'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   132
    stylesheet['Definition'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   133
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   134
    para = ParagraphStyle('Code', stylesheet['Normal'])
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   135
    para.fontName = 'Courier'
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   136
    para.fontSize = 16
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   137
    para.leading = 18
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   138
    para.leftIndent = 36
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   139
    stylesheet['Code'] = para
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   140
490f6b790498 Initial revision
rgbecker
parents:
diff changeset
   141
    return stylesheet