diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index 492a1ed..c2ad810 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -358,12 +358,16 @@ class Bureau(object): fontsdir = os.path.join(self.mdir, "fonts") self.log.debug(fontsdir) for font in glob.glob(fontsdir + "/*.otf"): - self.log.debug("adding font " + "file://" + font) - fontconfig.add_font_face("file://" + font, + fdict = {} + fdict["src"] = ("local", "file://" + font) + self.log.debug("adding font " + str(fdict)) + fontconfig.add_font_face(fdict, weasyprint.default_url_fetcher) for font in glob.glob(fontsdir + "/*.ttf"): - self.log.debug("adding font " + "file://" + font) - fontconfig.add_font_face("file://" + font, + fdict = {} + fdict["src"] = ("local", "file://" + font) + self.log.debug("adding font " + str(fdict)) + fontconfig.add_font_face(fdict, 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)