From 633ae39ec92c96768d01a740ad6187dfc8ae746b Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Thu, 19 Dec 2019 15:58:24 +0100 Subject: [PATCH] add local fonts all at once --- screenless/bureau/bureau.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index e2db59f..98e54eb 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -365,9 +365,9 @@ class Bureau(object): for font in glob.glob(fontsdir + "/*.ttf"): fontlist.append(("local", "file://" + font)) self.log.debug("adding font " + str(fdict)) - fdict["src"] = fontlist + fdict = { "src": fontlist } fontconfig.add_font_face(fdict, - weasyprint.default_url_fetcher) + weasyprint.default_url_fetcher) weasyprint.HTML(string=templ.render_unicode(**kwargs)).write_pdf(pdfpath, font_config=fontconfig) subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " + pdfpath, shell=True)