aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screenplain/export/pdf.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/screenplain/export/pdf.py b/screenplain/export/pdf.py
index dcad855..957dd82 100644
--- a/screenplain/export/pdf.py
+++ b/screenplain/export/pdf.py
@@ -12,6 +12,7 @@ from reportlab.platypus import (
from reportlab import platypus
from reportlab.lib.units import inch
from reportlab.lib.styles import ParagraphStyle
+from reportlab.lib.enums import TA_CENTER
from screenplain.types import (
Action, Dialog, DualDialog, Transition, Slug
@@ -60,6 +61,10 @@ action_style = ParagraphStyle(
'action', default_style,
spaceBefore=12,
)
+centered_action_style = ParagraphStyle(
+ 'centered-action', action_style,
+ alignment=TA_CENTER,
+)
slug_style = ParagraphStyle(
'slug', default_style,
spaceBefore=12,
@@ -132,8 +137,10 @@ def to_pdf(screenplay, output_filename, template_constructor=DocTemplate):
elif isinstance(para, DualDialog):
add_dual_dialog(story, para)
elif isinstance(para, Action):
- # TODO: heed para.centered
- add_paragraph(story, para, action_style)
+ add_paragraph(
+ story, para,
+ centered_action_style if para.centered else action_style
+ )
elif isinstance(para, Slug):
add_paragraph(story, para, slug_style)
elif isinstance(para, Transition):