1
"""This is an example style sheet. You can create your own, and
2
have them loaded by the presentation. A style sheet is just a
3
dictionary, where they keys are style names and the values are
4
ParagraphStyle objects.
6
You must provide a function called "getParagraphStyles()" to
7
return it. In future, we can put things like LineStyles,
8
TableCellStyles etc. in the same modules.
10
You might wish to have two parallel style sheets, one for colour
11
and one for black and white, so you can switch your presentations
14
A style sheet MUST define a style called 'Normal'.
17
from reportlab.lib import styles
18
from reportlab.lib.colors import *
19
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
22
def getParagraphStyles():
23
"""Returns a dictionary of styles based on Helvetica"""
26
ParagraphStyle = styles.ParagraphStyle
28
para = ParagraphStyle('Normal', None) #the ancestor of all
29
para.fontName = 'Helvetica-Bold'
32
para.textColor = white
33
stylesheet['Normal'] = para
35
para = ParagraphStyle('BodyText', stylesheet['Normal'])
37
stylesheet['BodyText'] = para
39
para = ParagraphStyle('BigCentered', stylesheet['Normal'])
41
para.alignment = TA_CENTER
42
stylesheet['BigCentered'] = para
44
para = ParagraphStyle('Italic', stylesheet['BodyText'])
45
para.fontName = 'Helvetica-Oblique'
46
para.textColor = white
47
stylesheet['Italic'] = para
49
para = ParagraphStyle('Title', stylesheet['Normal'])
50
para.fontName = 'Helvetica'
54
para.alignment = TA_CENTER
55
stylesheet['Title'] = para
57
para = ParagraphStyle('Heading1', stylesheet['Normal'])
58
para.fontName = 'Helvetica-Bold'
59
para.fontSize = 48# 36
62
para.textColor = green
63
para.alignment = TA_LEFT
64
stylesheet['Heading1'] = para
66
para = ParagraphStyle('Heading2', stylesheet['Normal'])
67
para.fontName = 'Helvetica-Bold'
72
stylesheet['Heading2'] = para
74
para = ParagraphStyle('Heading3', stylesheet['Normal'])
75
para.fontName = 'Helvetica-BoldOblique'
78
stylesheet['Heading3'] = para
80
para = ParagraphStyle('Bullet', stylesheet['Normal'])
81
para.firstLineIndent = -18
84
para.bulletFontName = 'Symbol'
85
para.bulletFontSize = 24
86
para.bulletIndent = 36
87
stylesheet['Bullet'] = para
89
para = ParagraphStyle('Definition', stylesheet['Normal'])
90
#use this for definition lists
91
para.firstLineIndent = 0
95
para.bulletFontName = 'Helvetica-BoldOblique'
96
stylesheet['Definition'] = para
98
para = ParagraphStyle('Code', stylesheet['Normal'])
99
para.fontName = 'Courier-Bold'
103
para.textColor = chartreuse
104
stylesheet['Code'] = para
b'\\ No newline at end of file'