Allow plugins to declare fonts "pdf-only"

This commit is contained in:
Raphael Michel
2022-04-07 17:58:33 +02:00
parent 20c6f0b327
commit 24e7be4142
2 changed files with 5 additions and 4 deletions

View File

@@ -86,9 +86,9 @@ def primary_font_kwargs():
from pretix.presale.style import get_fonts from pretix.presale.style import get_fonts
choices = [('Open Sans', 'Open Sans')] choices = [('Open Sans', 'Open Sans')]
choices += [ choices += sorted([
(a, {"title": a, "data": v}) for a, v in get_fonts().items() (a, {"title": a, "data": v}) for a, v in get_fonts().items() if not v.get('pdf_only', False)
] ], key=lambda a: a[0])
return { return {
'choices': choices, 'choices': choices,
} }

View File

@@ -215,7 +215,8 @@ Return a dictionaries of the following structure. Paths should be relative to st
}, },
"bolditalic": { "bolditalic": {
... ...
} },
"pdf_only": False, # if True, font is not usable on the web
} }
} }
""" """