Skip to content

Commit

Permalink
Adopt courier font for headers and footers
Browse files Browse the repository at this point in the history
Address issue: py-pdf/fpdf2#1090
  • Loading branch information
evilaliv3 committed May 22, 2024
1 parent 4c024ec commit 0464d2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/globaleaks/handlers/recipient/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@ def __init__(self, *args, **kwargs):
self.set_text_shaping(use_shaping_engine=True, direction="ltr")

def header(self):
self.set_font(self.report_default_font, "", 9)
self.cell(80)
self.set_font("courier", "", 9)
self.set_text_shaping(use_shaping_engine=True, direction="ltr")
self.cell(30, 10, self.title, align="C")
self.set_text_shaping(use_shaping_engine=True, direction=self.report_direction)
self.set_font(self.report_default_font, "", 11)
self.ln(20)


def footer(self):
self.set_y(-15)
self.set_font(self.report_default_font, "", 9)
self.set_font("courier", "", 9)
self.set_text_shaping(use_shaping_engine=True, direction="ltr")
self.cell(0, 10, f"{self.page_no()}/{{nb}}", align="C")
self.set_text_shaping(use_shaping_engine=True, direction=self.report_direction)
self.set_font(self.report_default_font, "", 11)

def output(self, *args, **kwargs):
for font in list(self.fonts.keys()):
Expand Down

0 comments on commit 0464d2a

Please sign in to comment.