mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Support custom fonts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from django.dispatch import Signal, receiver
|
||||
from django.dispatch import receiver
|
||||
from django.template.loader import get_template
|
||||
from django.urls import resolve
|
||||
|
||||
@@ -6,6 +6,9 @@ from pretix.base.signals import (
|
||||
register_data_exporters, register_ticket_outputs,
|
||||
)
|
||||
from pretix.control.signals import html_head
|
||||
from pretix.presale.style import ( # NOQA: legacy import
|
||||
get_fonts, register_fonts,
|
||||
)
|
||||
|
||||
|
||||
@receiver(register_ticket_outputs, dispatch_uid="output_pdf")
|
||||
@@ -30,35 +33,3 @@ def html_head_presale(sender, request=None, **kwargs):
|
||||
})
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
||||
register_fonts = Signal()
|
||||
"""
|
||||
Return a dictionaries of the following structure. Paths should be relative to static root.
|
||||
|
||||
{
|
||||
"font name": {
|
||||
"regular": {
|
||||
"truetype": "….ttf",
|
||||
"woff": "…",
|
||||
"woff2": "…"
|
||||
},
|
||||
"bold": {
|
||||
...
|
||||
},
|
||||
"italic": {
|
||||
...
|
||||
},
|
||||
"bolditalic": {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
def get_fonts():
|
||||
f = {}
|
||||
for recv, value in register_fonts.send(0):
|
||||
f.update(value)
|
||||
return f
|
||||
|
||||
Reference in New Issue
Block a user