diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index a1683d3ee..c9b9d358b 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -639,7 +639,7 @@ class EventSettingsForm(SettingsForm): if not event.has_subevents: del self.fields['frontpage_subevent_ordering'] self.fields['primary_font'].choices += [ - (a, a) for a in get_fonts() + (a, {"title": a, "data": v}) for a, v in get_fonts().items() ] diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py index 4aca838d0..ea59d5745 100644 --- a/src/pretix/control/forms/organizer.py +++ b/src/pretix/control/forms/organizer.py @@ -312,7 +312,7 @@ class OrganizerSettingsForm(SettingsForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['primary_font'].choices += [ - (a, a) for a in get_fonts() + (a, {"title": a, "data": v}) for a, v in get_fonts().items() ] diff --git a/src/pretix/control/templates/pretixcontrol/font_option.html b/src/pretix/control/templates/pretixcontrol/font_option.html index 8171cbc6a..33965ca13 100644 --- a/src/pretix/control/templates/pretixcontrol/font_option.html +++ b/src/pretix/control/templates/pretixcontrol/font_option.html @@ -1,2 +1,2 @@ -{% load i18n %}{% if widget.wrap_label %}{% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.wrap_label %} {{ widget.label }}
{% trans "The quick brown fox jumps over the lazy dog." context "typography" %}{% endif %} +{% load getitem %}{% load i18n %}{% if widget.wrap_label %}{% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.wrap_label %} {{ widget.label.title }}
{% trans "The quick brown fox jumps over the lazy dog." context "typography" %}{% if "sample" in widget.label.data %}
{{ widget.label.data.sample }}{% endif %}{% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/pdf/index.html b/src/pretix/control/templates/pretixcontrol/pdf/index.html index 318257b50..5856069e0 100644 --- a/src/pretix/control/templates/pretixcontrol/pdf/index.html +++ b/src/pretix/control/templates/pretixcontrol/pdf/index.html @@ -403,9 +403,12 @@ {% for family, styles in fonts.items %} {% for style, formats in styles.items %} + {% if "sample" not in style %} giItT1WQy@!-/# + {% if "_sample" in styles %}{{ styles.sample }}{% endif %} + {% endif %} {% endfor %} {% endfor %} {% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/pdf/webfonts.css b/src/pretix/control/templates/pretixcontrol/pdf/webfonts.css index 438883da1..4c627cc79 100644 --- a/src/pretix/control/templates/pretixcontrol/pdf/webfonts.css +++ b/src/pretix/control/templates/pretixcontrol/pdf/webfonts.css @@ -1,7 +1,20 @@ {% load static %} +@font-face { + font-family: 'AND'; + font-style: normal; + font-weight: normal; + src: url('{% static "fonts/AND-Regular.ttf" %}') format('truetype'); +} +@font-face { + font-family: 'AND'; + font-style: normal; + font-weight: bold; + src: url('{% static "fonts/AND-Regular.ttf" %}') format('truetype'); +} {% for family, styles in fonts.items %} {% for style, formats in styles.items %} +{% if "sample" not in style %} @font-face { font-family: '{{ family }}'; {% if style == "italic" or style == "bolditalic" %} @@ -19,7 +32,7 @@ {% if "truetype" in formats %}url('{% static formats.truetype %}') format('truetype'){% endif %}; } .preload-font[data-family="{{family}}"][data-style="{{style}}"] { - font-family: '{{ family }}'; + font-family: '{{ family }}', 'AND'; {% if style == "italic" or style == "bolditalic" %} font-style: italic; {% else %} @@ -32,5 +45,6 @@ {% endif %} } +{% endif %} {% endfor %} {% endfor %} diff --git a/src/pretix/static/fonts/AND-Regular.ttf b/src/pretix/static/fonts/AND-Regular.ttf new file mode 100644 index 000000000..42f4593db Binary files /dev/null and b/src/pretix/static/fonts/AND-Regular.ttf differ