MCPcopy Create free account
hub / github.com/Distrotech/reportlab / getParagraphStyles

Function getParagraphStyles

tools/pythonpoint/styles/standard.py:9–132  ·  view source on GitHub ↗

Returns a dictionary of styles to get you started. We will provide a way to specify a module of these. Note that this just includes TableStyles as well as ParagraphStyles for any tables you wish to use.

()

Source from the content-addressed store, hash-verified

7
8
9def getParagraphStyles():
10 """Returns a dictionary of styles to get you started.
11
12 We will provide a way to specify a module of these. Note that
13 this just includes TableStyles as well as ParagraphStyles for any
14 tables you wish to use.
15 """
16
17 stylesheet = {}
18 ParagraphStyle = styles.ParagraphStyle
19
20 para = ParagraphStyle('Normal', None) #the ancestor of all
21 para.fontName = 'Times-Roman'
22 para.fontSize = 24
23 para.leading = 28
24 stylesheet['Normal'] = para
25
26 #This one is spaced out a bit...
27 para = ParagraphStyle('BodyText', stylesheet['Normal'])
28 para.spaceBefore = 12
29 stylesheet['BodyText'] = para
30
31 #Indented, for lists
32 para = ParagraphStyle('Indent', stylesheet['Normal'])
33 para.leftIndent = 36
34 para.firstLineIndent = 0
35 stylesheet['Indent'] = para
36
37 para = ParagraphStyle('Centered', stylesheet['Normal'])
38 para.alignment = TA_CENTER
39 stylesheet['Centered'] = para
40
41 para = ParagraphStyle('BigCentered', stylesheet['Normal'])
42 para.spaceBefore = 12
43 para.alignment = TA_CENTER
44 stylesheet['BigCentered'] = para
45
46 para = ParagraphStyle('Italic', stylesheet['BodyText'])
47 para.fontName = 'Times-Italic'
48 stylesheet['Italic'] = para
49
50 para = ParagraphStyle('Title', stylesheet['Normal'])
51 para.fontName = 'Times-Roman'
52 para.fontSize = 48
53 para.leading = 58
54 para.alignment = TA_CENTER
55 stylesheet['Title'] = para
56
57 para = ParagraphStyle('Heading1', stylesheet['Normal'])
58 para.fontName = 'Times-Bold'
59 para.fontSize = 36
60 para.leading = 44
61 para.alignment = TA_CENTER
62 stylesheet['Heading1'] = para
63
64 para = ParagraphStyle('Heading2', stylesheet['Normal'])
65 para.fontName = 'Times-Bold'
66 para.fontSize = 28

Callers 1

getSampleStyleSheetFunction · 0.90

Calls 2

TableStyleClass · 0.90
ParagraphStyleClass · 0.85

Tested by

no test coverage detected