summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2024-02-16 14:05:27 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2024-02-16 14:05:27 +0100
commit0e7ea5ca80ad8cfd61a3591b2dea303df6c8238c (patch)
tree94634fd47d433381541614516b1d7e3b6509e3fa /forms
parente03dfd3b813929067e5b5c30752e336ea2be1f70 (diff)
Change fonts used in the chart
Diffstat (limited to 'forms')
-rwxr-xr-xforms/colour_chart.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/forms/colour_chart.py b/forms/colour_chart.py
index 30d97d7..efcd7d0 100755
--- a/forms/colour_chart.py
+++ b/forms/colour_chart.py
@@ -44,13 +44,26 @@ class Chart:
def write_pdf(self, fname):
pdf = fpdf.FPDF(format="A5")
+ pdf.add_font(
+ family="FreeSans",
+ fname="/usr/share/fonts/opentype/freefont/FreeSans.otf",
+ )
+ pdf.add_font(
+ family="FreeSans",
+ style="B",
+ fname="/usr/share/fonts/opentype/freefont/FreeSansBold.otf",
+ )
+ pdf.add_font(
+ family="FreeSerif",
+ fname="/usr/share/fonts/opentype/freefont/FreeSerif.otf",
+ )
for p_num, page in enumerate(self.get_arranged_cells()):
pdf.add_page()
- pdf.set_font("helvetica", size=12)
+ pdf.set_font("FreeSerif", size=12)
pdf.cell(64, 8, self.data["title"], align="C")
pdf.ln()
- pdf.set_font("helvetica", "B", 12)
+ pdf.set_font("FreeSans", "B", 12)
for j in range(self.COLUMNS):
pdf.cell(16, 8, str(j + p_num * self.COLUMNS),)
pdf.cell(16, 8, "")