summaryrefslogtreecommitdiff
path: root/postgresqleu/settings.py
diff options
context:
space:
mode:
authorMagnus Hagander2022-10-18 09:27:57 +0000
committerMagnus Hagander2022-10-18 09:27:57 +0000
commit7567cc57ba20287d735cc9c7e9b2d7d401333714 (patch)
tree0b34c1db1adf8b40a9f35dd8ea665fe51627c2ff /postgresqleu/settings.py
parent9c6e497562d703ef6c2303a943228d6c95a0e2d6 (diff)
Add core support for non-dejavu ttf fonts
This adds the support for registering more than dejavu fonts to the system, and tries to do so in a backwards compatible fashion. That means the old FONTROOT setting remains but now instead means the root for the DejaVu fonts only. Further fonts can be added in local_settings.py specifying botht he name of the font and the full path to the ttf file.
Diffstat (limited to 'postgresqleu/settings.py')
-rw-r--r--postgresqleu/settings.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/postgresqleu/settings.py b/postgresqleu/settings.py
index 0e586d4b..8ddeb88b 100644
--- a/postgresqleu/settings.py
+++ b/postgresqleu/settings.py
@@ -120,7 +120,7 @@ INSTALLED_APPS = [
'postgresqleu.membership',
]
-# Root directory for truetype fonts
+# Root directory for DejaVu truetype fonts
FONTROOT = "/usr/share/fonts/truetype/ttf-dejavu"
# List of IP addresses (v4 and v6) that is allowed to access monitoring urls
@@ -256,6 +256,18 @@ ADMINS = (
)
MANAGERS = ADMINS
+
+# Fonts setup if not already done
+_dejavu_fonts = [
+ ('DejaVu Serif', '{}/DejaVuSerif.ttf'.format(FONTROOT)),
+ ('DejaVu Serif Italic', '{}/DejaVuSerif-Italic.ttf'.format(FONTROOT)),
+ ('DejaVu Serif Bold', '{}/DejaVuSerif-Bold.ttf'.format(FONTROOT)),
+]
+if 'REGISTER_FONTS' not in locals():
+ REGISTER_FONTS = _dejavu_fonts
+else:
+ REGISTER_FONTS = _dejavu_fonts + REGISTER_FONTS
+
# Invoice module
# --------------
INVOICE_TITLE_PREFIX = '{0} Invoice'.format(ORG_NAME)