Skip to content

Commit

Permalink
Only apply scaling of attribute if attribute available for reportlab …
Browse files Browse the repository at this point in the history
…style
  • Loading branch information
cydanil committed Jul 12, 2021
1 parent 778c4d7 commit 0133f98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gourmet/plugins/import_export/pdf_plugin/pdf_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,15 @@ def setup_frames(self,
f'not {mode}')
return frames

def scale_stylesheet (self, perc):
for name,sty in list(self.styleSheet.byName.items()):
def scale_stylesheet(self, perc: float):
for name, sty in list(self.styleSheet.byName.items()):
for attr in ['firstLineIndent',
'fontSize',
'leftIndent',
'rightIndent',
'leading']:
setattr(sty,attr,int(perc*getattr(sty,attr)))
if hasattr(sty, attr):
setattr(sty, attr, int(perc * getattr(sty, attr)))

def setup_column_frames (self, n):
COLUMN_SEPARATOR = 0.5 * inch
Expand Down

0 comments on commit 0133f98

Please sign in to comment.