~toolpart/openobject-server/toolpart

« back to all changes in this revision

Viewing changes to bin/reportlab/tools/pythonpoint/styles/projection.py

  • Committer: pinky
  • Date: 2006-12-07 13:41:40 UTC
  • Revision ID: pinky-3f10ee12cea3c4c75cef44ab04ad33ef47432907
New trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
5
 
 
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.
 
9
 
 
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
 
12
easily.
 
13
 
 
14
A style sheet MUST define a style called 'Normal'.
 
15
"""
 
16
 
 
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
 
20
 
 
21
 
 
22
def getParagraphStyles():
 
23
    """Returns a dictionary of styles based on Helvetica"""
 
24
 
 
25
    stylesheet = {}
 
26
    ParagraphStyle = styles.ParagraphStyle
 
27
 
 
28
    para = ParagraphStyle('Normal', None)   #the ancestor of all
 
29
    para.fontName = 'Helvetica-Bold'
 
30
    para.fontSize = 24
 
31
    para.leading = 28
 
32
    para.textColor = white
 
33
    stylesheet['Normal'] = para
 
34
 
 
35
    para = ParagraphStyle('BodyText', stylesheet['Normal'])
 
36
    para.spaceBefore = 12
 
37
    stylesheet['BodyText'] = para
 
38
 
 
39
    para = ParagraphStyle('BigCentered', stylesheet['Normal'])
 
40
    para.spaceBefore = 12
 
41
    para.alignment = TA_CENTER
 
42
    stylesheet['BigCentered'] = para
 
43
 
 
44
    para = ParagraphStyle('Italic', stylesheet['BodyText'])
 
45
    para.fontName = 'Helvetica-Oblique'
 
46
    para.textColor = white
 
47
    stylesheet['Italic'] = para
 
48
 
 
49
    para = ParagraphStyle('Title', stylesheet['Normal'])
 
50
    para.fontName = 'Helvetica'
 
51
    para.fontSize = 48
 
52
    para.Leading = 58
 
53
    para.spaceAfter = 36
 
54
    para.alignment = TA_CENTER
 
55
    stylesheet['Title'] = para
 
56
 
 
57
    para = ParagraphStyle('Heading1', stylesheet['Normal'])
 
58
    para.fontName = 'Helvetica-Bold'
 
59
    para.fontSize = 48# 36
 
60
    para.leading = 44
 
61
    para.spaceAfter = 36
 
62
    para.textColor = green
 
63
    para.alignment = TA_LEFT
 
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 = -18
 
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 = 0
 
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-Bold'
 
100
    para.fontSize = 16
 
101
    para.leading = 18
 
102
    para.leftIndent = 36
 
103
    para.textColor = chartreuse
 
104
    stylesheet['Code'] = para
 
105
 
 
106
    return stylesheet
 
 
b'\\ No newline at end of file'