From c4746d2306988eb399a94026f2aecd41ee7dd713 Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Tue, 1 Dec 2020 22:13:14 +0100 Subject: [PATCH] include webfont --- templates/shared/_layout.html | 6 ++---- views/js_cardgame.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/shared/_layout.html b/templates/shared/_layout.html index e0a6212..6505ef2 100644 --- a/templates/shared/_layout.html +++ b/templates/shared/_layout.html @@ -57,16 +57,14 @@ }; - diff --git a/views/js_cardgame.py b/views/js_cardgame.py index 4d5d63d..077578a 100644 --- a/views/js_cardgame.py +++ b/views/js_cardgame.py @@ -28,6 +28,20 @@ def css(req, resp, file): resp.content = fin.read() +@api.route("/js-cardgame/font/{file}") +def css(req, resp, file): + resp.headers['Content-Type'] = 'application/octet-stream' + full_file = os.path.join( + os.path.dirname(__file__), + '..', + 'js-cardgame', + file + ) + with open(full_file, 'rb') as fin: + resp.content = fin.read() + + + @api.route("/js-cardgame/js/{file}") def css(req, resp, file): resp.headers['Content-Type'] = 'application/javascript'