author | rgbecker |
Wed, 25 Oct 2000 08:57:46 +0000 | |
changeset 494 | 54257447cfe9 |
parent 253 | cfcf8d555a2c |
child 546 | 8e17202e9067 |
permissions | -rw-r--r-- |
494 | 1 |
#copyright ReportLab Inc. 2000 |
2 |
#see license.txt for license details |
|
3 |
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/demos/pythonpoint/styles_modern.py?cvsroot=reportlab |
|
4 |
#$Header: /tmp/reportlab/reportlab/demos/pythonpoint/Attic/styles_modern.py,v 1.7 2000/10/25 08:57:44 rgbecker Exp $ |
|
5 |
__version__=''' $Id: styles_modern.py,v 1.7 2000/10/25 08:57:44 rgbecker Exp $ ''' |
|
4 | 6 |
# style_modern.py |
16 | 7 |
__doc__="""This is an example style sheet. You can create your own, and |
4 | 8 |
have them loaded by the presentation. A style sheet is just a |
9 |
dictionary, where they keys are style names and the values are |
|
253 | 10 |
ParagraphStyle objects. |
4 | 11 |
|
12 |
You must provide a function called "getParagraphStyles()" to |
|
13 |
return it. In future, we can put things like LineStyles, |
|
14 |
TableCellStyles etc. in the same modules. |
|
15 |
||
16 |
You might wish to have two parallel style sheets, one for colour |
|
17 |
and one for black and white, so you can switch your presentations |
|
18 |
easily. |
|
19 |
||
20 |
A style sheet MUST define a style called 'Normal'. |
|
21 |
""" |
|
22 |
||
222
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
23 |
from reportlab.lib import styles |
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
24 |
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY |
4 | 25 |
|
26 |
def getParagraphStyles(): |
|
27 |
"""Returns a dictionary of styles based on Helvetica""" |
|
28 |
stylesheet = {} |
|
222
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
29 |
ParagraphStyle = styles.ParagraphStyle |
4 | 30 |
|
31 |
para = ParagraphStyle('Normal', None) #the ancestor of all |
|
32 |
para.fontName = 'Helvetica' |
|
33 |
para.fontSize = 24 |
|
34 |
para.leading = 28 |
|
35 |
stylesheet['Normal'] = para |
|
36 |
||
37 |
para = ParagraphStyle('BodyText', stylesheet['Normal']) |
|
38 |
para.spaceBefore = 12 |
|
39 |
stylesheet['BodyText'] = para |
|
40 |
||
41 |
para = ParagraphStyle('BigCentered', stylesheet['Normal']) |
|
42 |
para.spaceBefore = 12 |
|
222
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
43 |
para.alignment = TA_CENTER |
4 | 44 |
stylesheet['BigCentered'] = para |
45 |
||
46 |
para = ParagraphStyle('Italic', stylesheet['BodyText']) |
|
47 |
para.fontName = 'Helvetica-Oblique' |
|
48 |
stylesheet['Italic'] = para |
|
49 |
||
50 |
para = ParagraphStyle('Title', stylesheet['Normal']) |
|
51 |
para.fontName = 'Helvetica' |
|
52 |
para.fontSize = 48 |
|
53 |
para.Leading = 58 |
|
54 |
para.spaceAfter = 36 |
|
222
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
55 |
para.alignment = TA_CENTER |
4 | 56 |
stylesheet['Title'] = para |
57 |
||
58 |
para = ParagraphStyle('Heading1', stylesheet['Normal']) |
|
59 |
para.fontName = 'Helvetica-Bold' |
|
60 |
para.fontSize = 36 |
|
61 |
para.leading = 44 |
|
62 |
para.spaceAfter = 36 |
|
222
f04b9db53afc
Allowed intra-paragraph text; fixed various bugs
andy_robinson
parents:
16
diff
changeset
|
63 |
para.alignment = TA_CENTER |
4 | 64 |
stylesheet['Heading1'] = para |
65 |
||
66 |
para = ParagraphStyle('Heading2', stylesheet['Normal']) |
|
67 |
para.fontName = 'Helvetica-Bold' |
|
68 |
para.fontSize = 28 |
|
69 |
para.leading = 34 |
|
70 |
para.spaceBefore = 24 |
|
71 |
para.spaceAfter = 12 |
|
72 |
stylesheet['Heading2'] = para |
|
73 |
||
74 |
para = ParagraphStyle('Heading3', stylesheet['Normal']) |
|
75 |
para.fontName = 'Helvetica-BoldOblique' |
|
76 |
para.spaceBefore = 24 |
|
77 |
para.spaceAfter = 12 |
|
78 |
stylesheet['Heading3'] = para |
|
79 |
||
80 |
para = ParagraphStyle('Bullet', stylesheet['Normal']) |
|
81 |
para.firstLineIndent = 54 |
|
82 |
para.leftIndent = 72 |
|
83 |
para.spaceBefore = 6 |
|
84 |
#para.bulletFontName = 'Symbol' |
|
85 |
para.bulletFontSize = 24 |
|
86 |
para.bulletIndent = 36 |
|
87 |
stylesheet['Bullet'] = para |
|
88 |
||
89 |
para = ParagraphStyle('Definition', stylesheet['Normal']) |
|
90 |
#use this for definition lists |
|
91 |
para.firstLineIndent = 72 |
|
92 |
para.leftIndent = 72 |
|
93 |
para.bulletIndent = 0 |
|
94 |
para.spaceBefore = 12 |
|
95 |
para.bulletFontName = 'Helvetica-BoldOblique' |
|
96 |
stylesheet['Definition'] = para |
|
97 |
||
98 |
para = ParagraphStyle('Code', stylesheet['Normal']) |
|
99 |
para.fontName = 'Courier' |
|
100 |
para.fontSize = 16 |
|
101 |
para.leading = 18 |
|
102 |
para.leftIndent = 36 |
|
103 |
stylesheet['Code'] = para |
|
104 |
||
105 |
return stylesheet |